This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: BROKEN: pthreads and c++ statically linked


On Tue, Nov 08, 2005 at 09:31:56AM -0500, Dixon, Lee L. wrote:
> I really don't know what I could be doing wrong, but on a _stock_ FC4
> install, I'm having a segfault in a pthread call when
> statically linked and including iostream (or STL includes like string)
> 
> Here's the code:
> 
> #include <pthread.h>
> #include <iostream>
> 
> int main(int argc, char *argv[])
> {
>   pthread_mutexattr_t attr;
>   pthread_mutexattr_init( &attr );
> }

This is a known problem, see
http://gcc.gnu.org/ml/gcc/2005-10/msg00235.html
for details.

In the mean time, don't link statically (which is a terribly bad idea
anyway), or use -Wl,--whole-archive -lpthread -Wl,--no-whole-archive.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]