
30 Nov
2007
30 Nov
'07
10:17 a.m.
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