Boost logo

Boost Users :

Subject: Re: [Boost-users] thread linking strangeness
From: Nikolai N Fetissov (nikolai-boost_at_[hidden])
Date: 2008-11-17 22:46:02


> I am observing strange things while linking boost::thread on a linux
> system with gcc 3.4.6.
>
> If I link an app with
> -L[path to boost.thread] -lboost_thread-gcc34-mt
> then it links fine.
>
> If I link with
> [path to boost.thread]/libboost_thread-gcc34-mt-1_36.a
> then I get linker errors with unresolved externals to things like:
> pthread_mutexattr_init
> pthread_detach
> pthread_getspecific
>
> I suspect it has to do with dynamic vs. static libraries. I have two
> flavors built:
> libboost_thread-gcc34-mt-1_36.so.1.36.0
> libboost_signals-gcc34-mt-1_36.a
>
> So I suspect that in the first case I am getting a dll while in the
> second case the static link fails for some reason. Any suggestions/
> tips to get the static link to work?
>

Add -pthread to the list of compiler flags.

--
 Nikolai

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net