www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Building libraries on Linux

reply Sean Kelly <sean f4.ca> writes:
This one is a tad weird and I'm hoping someone can explain it to me. 
When I try to build a library on Linux (Ares) and then link against that 
library, I get a bunch of link errors saying "undefined reference to 
'_ModuleInfo_3std1c6string'" and so on.  It appears this problem goes 
away if empty unittest blocks are added to all modules currently lacking 
unit tests, but this seems an odd fix.  I've tried building the library 
with a variety of switches for 'ar' but still see the problem.  Am I 
doing something wrong, or is this a DMD bug?  I can't find any 
significant differences in how my library is being built compared to how 
Phobos is built.  Does it actually matter that libphobos.a is built as a 
demendency of unittest.d?


Sean
Mar 03 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sean Kelly schrieb am 2006-03-04:
 This one is a tad weird and I'm hoping someone can explain it to me. 
 When I try to build a library on Linux (Ares) and then link against that 
 library, I get a bunch of link errors saying "undefined reference to 
 '_ModuleInfo_3std1c6string'" and so on.  It appears this problem goes 
 away if empty unittest blocks are added to all modules currently lacking 
 unit tests, but this seems an odd fix.  I've tried building the library 
 with a variety of switches for 'ar' but still see the problem.  Am I 
 doing something wrong, or is this a DMD bug?  I can't find any 
 significant differences in how my library is being built compared to how 
 Phobos is built.  Does it actually matter that libphobos.a is built as a 
 demendency of unittest.d?
unittest.d isn't the cause. http://dstress.kuehne.cn/dstress.kuehne.cn/complex/typeinfo_init/a.d http://dstress.kuehne.cn/dstress.kuehne.cn/complex/typeinfo_init/b.d 1) FAIL dmd -c complex/typeinfo_init/a.d dmd a.o complex/typeinfo_init/b.d 2) FAIL dmd -c complex/typeinfo_init/b.d dmd b.o complex/typeinfo_init/a.d 3) PASS dmd complex/typeinfo_init/a.d complex/typeinfo_init/b.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFECT4l3w+/yD4P9tIRAm2NAJwMYxv7FPaAagdVzR2ht1kl5A8QuQCgxprR ugAGP7V9wU2go9XjaAeErG4= =uSH/ -----END PGP SIGNATURE-----
Mar 03 2006
prev sibling parent Frank Benoit <frank nix.de> writes:
since even "objdump -t file.o" says that the ModuleInfo is not defined,
ar cannot fix it.
Mar 05 2006