Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2007-11-30 05:17:38


Barco You <barcojie <at> gmail.com> writes:

> Sorry, it's 1.34.1 :)
> what does -pthread mean? it means libpthread linked, why doesn't it be
> -lpthread?

gcc has various options for enabling multi-threaded support. These depend on the
version of gcc and the platform. On some platforms/versions it is -pthread, on
others -pthreads, on some it -mthread, and on some -mthreads. You will need to
check the cygwin docs to find which to use (gcc --help -v might help). I think
it's -mthreads.

If all that was required was linking the pthread library, -lpthread would indeed
be sufficient. However, gcc also changes the code it generates, and the runtime
library functions it uses if multi-threaded support is enabled.

Anthony


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk