Subj : Re: Where to download a pthread library To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Thu Mar 31 2005 12:35 pm ptjm@interlog.com (Patrick TJ McPhee) writes: > % - Check if -pthread option causes a warning. If no, keep it, otherwise > % drop it. > > Keeping in mind that different compilers use different options, and > even gcc uses different options on different platforms (-pthread > doesn't work on Solaris or AIX, but there are gcc-specific options > which do). I'm now checking -pthread, -pthreads and -mt. That is: 1. Find first of these options which doesn't cause an error message from the compiler. Don't add any options if none are recognized. 2. Under these settings, check if pthread_create returns 0. 3. If pthread_create works, keep the options and use pthreads. Otherwise revert the options and don't use pthreads. Anything else? Should I try -lpthread too? GCC docs describe -pthread, -pthreads and -mt only in architecture-specific chapters. They don't say anything about an option which is portable to all GCC ports. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .