none
fatal error: C1083 : can not open include file "pthread.h" : No such file or directory RRS feed

  • Question

  • Hello friends

    I am learning Qualnet. i am trying to compile using Visual studio 10.00 command prompt.

    when I run Nmake command.

    I got error C 1083.

    there is a folder named "windows" with in "include" folder . Windows folder contains pthread.h but include does not contain. how to resolve this problem.

    Qualnet is a network simulator.

    Thursday, March 14, 2013 6:02 AM

Answers

  • Actually, if #include <pthread.h> would find it, the language requires #include "pthread.h" to find it as well, as the language says that if the implementation-defined search for the include file fails, it needs to do the search as if it had used the <> delimeters.

    It's all system defined (in fact the <> doesn't technically mean it surrounds a file name, just a legal header name).   It's good practice to use the <> for system files as the "" version typically searches other places (like the project directories).

    Visual C++ specifically defines the searching rules it uses here:  http://msdn.microsoft.com/en-us/library/36k2cdd4(v=vs.80).aspx

    The real issue is that VisualStudio doesn't provide a pthreads library for which this header belongs.

    You can find one on sourceware.org/pthreads-win32


    Thursday, March 14, 2013 2:21 PM

All replies

  • Is the file name in your #include statement <pthread.h> or "pthread.h"?  The first form should be reserved for standard headers.  For the second form, the system needs to know which folder to look in.  Either use the full path name in the #include directive or tell Nmake that it should look in the folder in question.

    Thursday, March 14, 2013 1:09 PM
  • Actually, if #include <pthread.h> would find it, the language requires #include "pthread.h" to find it as well, as the language says that if the implementation-defined search for the include file fails, it needs to do the search as if it had used the <> delimeters.

    It's all system defined (in fact the <> doesn't technically mean it surrounds a file name, just a legal header name).   It's good practice to use the <> for system files as the "" version typically searches other places (like the project directories).

    Visual C++ specifically defines the searching rules it uses here:  http://msdn.microsoft.com/en-us/library/36k2cdd4(v=vs.80).aspx

    The real issue is that VisualStudio doesn't provide a pthreads library for which this header belongs.

    You can find one on sourceware.org/pthreads-win32


    Thursday, March 14, 2013 2:21 PM