0

Possible Duplicate:
Can I get C’s pthread.h to compile in Windows?

I am using eclipse on Windows 7.I am trying multi threaded programming in C.But I am not able to include pthread.h.It says No such file or directory.It worked on another Windows 7 machine but does not seem to work on this one.Please help me out.

Community
  • 1
  • 1
SB26
  • 225
  • 1
  • 6
  • 17
  • 1
    pthread is a unix library, so if it worked on another windows installation, it must have been because you used a port of the library for windows. – Jasper Oct 23 '12 at 01:35
  • The P in Pthread stands for POSIX, which is a standard used on most UNIX or UNIX-like operating systems (like Linux and OSX). It's _not_ available for Windows. See instead a Windows-specific reference of [threads and processes](http://msdn.microsoft.com/en-us/library/windows/desktop/ms684852%28v=vs.85%29.aspx). – Some programmer dude Oct 23 '12 at 01:36

1 Answers1

1

pthreads, also known as POSIX threads, are a facility of POSIX-conformant operating systems (usually Unix-like systems, such as Linux and Mac OS X.) Windows does not have it. You will need to install a Windows port of pthreads. You can get it here: http://sources.redhat.com/pthreads-win32

Nikos C.
  • 50,738
  • 9
  • 71
  • 96
  • I tried this but it does not work – SB26 Oct 23 '12 at 01:46
  • @SB26 You will probably need to tell your compiler where to find the header files as well as the library files. How you do that depends on your compiler. – Nikos C. Oct 23 '12 at 01:51
  • I am using MinGW and the header files are in that folder.I extracted the header files related to POSIX in that particular folder. – SB26 Oct 23 '12 at 01:53