g++, pthreads, -D__STL_PTHREADS, and link errors

Rich Garabedian rgarabed@tripod.com
Wed Mar 17 09:03:00 GMT 1999


Greetings,

    I'm having a great deal of difficulty building a multi-threaded app,

and I'm running out of options. Basically, this app uses many constructs

from STL. In particular, it uses stl strings. Since my app is
multi-threaded, I need the thread - safe sections of code from the STL
headers, so I'm compiling with  -D__EXTENSIONS__, -D_REENTRANT,
-D_POSIX_SOURCE=199506L, and -D__STL_PTHREADS. Now here comes the
kicker. If I use -D__STL_PTHREADS and use (or even just instantiate) an
STL string, the linker starts complaining about missing functions called

by bastring. Remove either one of the above (remove strings or compile
without -D__STL_PTHREADS) and the code links fine.

I've included the output (-v switch enabled) from a bare bones test
program that does nothing more than create a thread, and output a
message. I also do simply declare a string in main.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rich Garabedian, Software Engineer

Tripod, inc.
160 Water Street
Williamstown, Ma 01267

http://www.tripod.com



More information about the Gcc mailing list