Question

I regularly rebuild and use DMD git master locally on Ubuntu 13.10. Yesterday my D toolchain fails to link all D programs with the error:

Example compilation output from DMD:

/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
/home/per/opt/x86_64-unknown-linux-gnu/dmd/bin/../lib/libphobos2.a(sections_linux_4c8_e6.o):src/rt/sections_linux.d:function 
_D2rt14sections_linux3DSO11__xopEqualsFKxS2rt14sections_linux3DSOKxS2rt14sections_linux3DSOZb: 
error: undefined reference to '_adEq2'
collect2: error: ld returned 1 exit status

When I grep for it only dmd binary matches this symbol, not libphobos. Both my dmd and libphobos are up-to-date.

I've tried both ld.bfd and ld.gold.

What is wrong?

Was it helpful?

Solution

I managed to get it working again by remove my D directory from LD_LIBRARY_PATH that contains runtime and phobos libs. Probably my mistake.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top