Bug 17825 – Structs with floating point fields fail to compile in betterC
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2017-09-13T14:01:51Z
Last change time
2018-02-10T10:03:15Z
Keywords
betterC
Assigned to
No Owner
Creator
Hassan
Comments
Comment #0 by azi.hassan — 2017-09-13T14:01:51Z
The following code fails to compile in betterC :
import core.stdc.stdio;
struct Foo
{
float x;
}
extern(C) int main(int argc, char** argv)
{
return 0;
}
Attempting to compile it results in the following errors :
$ dmd -betterC structbug.d
structbug.o:(.data._D11TypeInfo_xf6__initZ+0x0) : référence indéfinie vers « _D14TypeInfo_Const6__vtblZ »
structbug.o:(.data._D11TypeInfo_xf6__initZ+0x8) : référence indéfinie vers « _D10TypeInfo_f6__initZ »
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
(compiled with DMD32 D Compiler v2.076.0-dirty under Lubuntu 14.04)
The same problem occurs when using double instead of float.
The problem was initially posted here : http://forum.dlang.org/post/[email protected]
Comment #1 by bugzilla — 2018-02-10T10:03:15Z
*** This issue has been marked as a duplicate of issue 17843 ***