Strange linker problems
Benjamin Thaut
code at benjamin-thaut.de
Mon Mar 18 00:07:43 PDT 2013
I have a strange problem with gdc. The linker reports undefined
references to symbols, but exactly those symbols exist in the library
that I'm linking into the executable. The error message I get is:
C:\Users\Benjamin\AppData\Local\Temp\cc4pUOfp.o:main.d:(.text+0x3a):
undefined reference to `_D6thBase2io8writeflnFAyaYm'
But:
nm libthBase64d_mingw.a | grep writefln
000000000003c9b2 T _D6thBase2io8writeflnFAyaYm
I'm building with:
gdc -m64
-I"C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\druntime\import"
-I"C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos"
-I"C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\thBase\src"
-fversion=NOGCSAFE -o "test.exe"
-L"C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos"
-L. -lthBase64d_mingw -debuglib=phobosnogc64d_mingw -Wl,--verbose=2
-defaultlib=phobosnogc64d_mingw -v -pipe -nostdinc main.d
The verbose output of the linker also shows that it finds the correct
library file:
attempt to open
C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos/libthBase64d_mingw.dll.a
failed
attempt to open
C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos/thBase64d_mingw.dll.a
failed
attempt to open
C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos/libthBase64d_mingw.a
failed
attempt to open
C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos/thBase64d_mingw.lib
failed
attempt to open
C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos/libthBase64d_mingw.dll
failed
attempt to open
C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos/thBase64d_mingw.dll
failed
attempt to open
C:\Users\Benjamin\Documents\d-projects\Spacecraft-git\game\..\..\phobos\libthBase64d_mingw.a
failed
attempt to open ./libthBase64d_mingw.dll.a failed
attempt to open ./thBase64d_mingw.dll.a failed
attempt to open ./libthBase64d_mingw.a succeeded
Any ideas what is going wrong here?
Kind Regards
Benjamin Thaut
More information about the D.gnu
mailing list