[Issue 6121] New: Can't link with DMC C++ generated functions with long arguments
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 7 11:15:37 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6121
Summary: Can't link with DMC C++ generated functions with long
arguments
Product: D
Version: unspecified
Platform: Other
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-06-07 11:11:04 PDT ---
foo.d:
extern(C++) void test(int);
void main()
{
test(1);
}
bar.cpp:
void test(long)
{
};
$ dmc -c -cpp bar.cpp
$ dmd foo.d bar.obj
http://www.digitalmars.com/ctg/optlink.html
foo.obj(foo)
Error 42: Symbol Undefined ?test@@YAXH at Z (void cdecl test(int ))
Symbol reference in foo.obj (D):
?test@@YAXH at Z
Symbol in bar.obj (CPP):
?test@@YAXJ at Z
According to this page: http://www.digitalmars.com/ctg/ctgMemoryModel.html ,
long in DMC has the same size as int in D. I've tried various other types but
nothing works.
Only if I change bar.cpp's test to:
void test(int){}
then it will compile and link. So how am I supposed to link with C++ functions
that take a long if I can't change them?
Due to this bug I can't link DDMD with the backend of DMD 2.053.
Also, your DMC echoes 8.42n instead of 8.52c, fyi.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list