GCC programming: header pthread not found but installed

Brian Dessent brian@dessent.net
Sun Jul 9 19:10:00 GMT 2006


Serethos wrote:
> fails with a gcc call like:
> gcc test.c -lpthread
>> with the
> error: pthread.h: no such file or directory

The testcase compiles just fine for me with no errors. Please review
the problem reporting guidelines at <http://cygwin.com/problems.html>. 
You did not provide the requested cygcheck output, and so there is not
enough information in your message to be of any more help. As a guess I
would have to say that you're not using Cygwin's gcc due to some other
gcc being in the path, but that's just pure speculation.
By the way, including "-lpthread" is not necessary and serves no
purpose. All of the pthread support is in -lcygwin (cygwin1.dll), which
gets linked against by the gcc specs file regardless of what options you
use (except of course for -mno-cygwin.) There is no such separate
"pthreads library" as on unix, and libpthread.a is provided just so that
Makefiles that expect to be able to specify -lpthread continue to work,
but it is not necessary and serves no useful purpose.
Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /