Undefined reference to _d_throw

Steve Teale steve.teale at britseyeview.com
Sat Nov 2 13:12:24 PDT 2013


>> externals relating to libpthread. I suspect this may be a 
>> CodeBlocks
>> configuration error. I've tried every whichway but have not 
>> found a way
>> round this yet. Most frustrating.
>
> How are you compiling? DMD automatically links with libpthread. 
> You can pass the -v (verbose) flag to DMD to see what command 
> it uses for linking. Otherwise you could try and explicitly 
> link with libpthread:
>
> dmd main.d -L-lpthread

CodeBlocks is supervising the compilation. I had added the 
libraries to its recipe in the wrong order:

pthread
m
phobos2

The opposite way round it links OK, bu there's still something 
strange going on. When I try to run it, it fails with:

./compo: error while loading shared libraries: libphobos2.so.0.2: 
cannot open shared object file: No such file or directory

This is true, there is no such file. In /usr/lib/i386-linux-gnu 
there's only libphobos2.so - a real file - which in my 
understanding should be a link to an actual shared library file.

Is there a working shared Phobos library in 2.063, or is this a 
.deb file error. If I have /usr/lib/i386-linux-gnu/libphobos.a 
instead of phobos2, the program links and at least attempts to 
run. It may crash later, but that's my fault.

This is not just a CodeBlocks thing. I made a simple makefile 
instead that links the libraries in the right order. That links, 
but also fails with the missing Phobos shared library error.


More information about the Digitalmars-d mailing list