help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: statically linking pthreads


From: Paul Pluzhnikov
Subject: Re: statically linking pthreads
Date: Wed, 24 May 2006 06:17:56 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

VASILI3000@HOTMAIL.COM writes:

>> This should have worked. What were the errors?
>
> the errors are the same i got not specifying the compiler flag
> -pthread: lots of undefitned references to the pthread library
> functions. maybe my build system is not sane...

Time to find out why pthread_create() and friends are not being
defined.

First a sanity check:

  nm /path/to/libpthread.a | grep pthread_create

Here is what the output looks on my system:

$ nm /usr/lib/libpthread.a | grep pthread_create
00000eec T __pthread_create_2_1
00000eec T pthread_create

Assuming you get similar output, this command should provide
further clues:

  g++ -static threads_static.c -o threads_static -pthread \
    -Wl,--verbose,-ypthread_create

> the executable is meant for an embedded system

Ok, that's about the only time when it is reasonable to link -static.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]