Re: gcc question




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

.