Re: gcc question
- From: "David Schwartz" <davids@xxxxxxxxxxxxx>
- Date: 22 Aug 2006 12:33:34 -0700
Hadron Quark wrote:
Why does
gcc -pthread -g -pg mythreads.c -o mythreads
give me exactly the same output as
gcc -lpthread -g -pg mythreads.c -o mythreads
?
The '-pthread' options means to do whatever is necessary on your
platform to get POSIX pthreads support. The '-lpthread' option means to
link in libpthread. My bet is that on your platform, the only thing
necessary to get POSIX pthreads support is to link in a library called
'libpthread'.
You should most definitely prefer the first option. In the future,
something else might be needed to get POSIX pthreads support. In that
case, the first option should still work while the second might not.
DS
.
- References:
- gcc question
- From: Hadron Quark
- gcc question
- Prev by Date: Re: IDE for Linux with good code completion
- Next by Date: Re: IDE for Linux with good code completion
- Previous by thread: gcc question
- Next by thread: Window swapping
- Index(es):