Pthread h no such file or directory windows

If I try to compile a program with #include in it, I get the error: pthread.h: No such file or directory Is it possible to get this to compile in a Windows environment? I am ...

If I try to compile a program with

#include <pthread.h>

in it, I get the error:

pthread.h: No such file or directory

Is it possible to get this to compile in a Windows environment?

I am using Vista with the latest MinGW.

I do not want to use the Microsoft Windows Services for UNIX Version 3.5 as I will have to move this to a Unix environment.

asked Jan 27, 2010 at 22:53

naspinski's user avatar

naspinskinaspinski

33.6k36 gold badges112 silver badges161 bronze badges

pthread.h is a header for the Unix/Linux (POSIX) API for threads. A POSIX layer such as Cygwin would probably compile an app with #include <pthreads.h>.

The native Windows threading API is exposed via #include <windows.h> and it works slightly differently to Linux’s threading.

Still, there’s a replacement «glue» library maintained at http://sourceware.org/pthreads-win32/ ; note that it has some slight incompatibilities with MinGW/VS (e.g. see here).

Community's user avatar

answered Jan 27, 2010 at 22:56

6

pthread.h isn’t on Windows. But Windows has extensive threading functionality, beginning with CreateThread.

My advice is don’t get caught looking at WinAPI through the lens of another system’s API. These systems are different. It’s like insisting on riding the Win32 bike with your comfortable Linux bike seat. Well, the seat might not fit right and in some cases it’ll just fall off.

Threads pretty much work the same on different systems, you have ThreadPools and mutexes. Having worked with both pthreads and Windows threads, I can say the Windows threading offers quite a bit more functionality than pthread does.

Learning another API is pretty easy, just think in terms of the concepts (mutex, etc), then look up how to create one of those on MSDN.

answered Aug 21, 2013 at 10:26

bobobobo's user avatar

bobobobobobobobo

63.6k60 gold badges254 silver badges355 bronze badges

0

Just pick up the TDM-GCC 64x package. (It constains both the 32 and 64 bit versions of the MinGW toolchain and comes within a neat installer.) More importantly, it contains something called the «winpthread» library.

It comprises of the pthread.h header, libwinpthread.a, libwinpthread.dll.a static libraries for both 32-bit and 64-bit and the required .dlls libwinpthread-1.dll and libwinpthread_64-1.dll(this, as of 01-06-2016).

You’ll need to link to the libwinpthread.a library during build. Other than that, your code can be the same as for native Pthread code on Linux. I’ve so far successfully used it to compile a few basic Pthread programs in 64-bit on windows.

Alternatively, you can use the following library which wraps the windows threading API into the pthreads API:
pthreads-win32.

The above two seem to be the most well known ways for this.

Hope this helps.

answered Jun 2, 2016 at 17:15

Keyboard Penman's user avatar

There are, as i recall, two distributions of the gnu toolchain for windows: mingw and cygwin.

I’d expect cygwin work — a lot of effort has been made to make that a «stadard» posix environment.

The mingw toolchain uses msvcrt.dll for its runtime and thus will probably expose msvcrt’s «thread» api: _beginthread which is defined in <process.h>

answered Jan 27, 2010 at 23:09

Chris Becke's user avatar

Chris BeckeChris Becke

33.3k12 gold badges77 silver badges144 bronze badges

Содержание

  1. Fatal error pthread h no such file or directory windows
  2. Answered by:
  3. Question
  4. Answers
  5. fatal error C1083: Cannot open include file: ‘pthread.h’: No such file or directory
  6. 1 answer
  7. «pthread.h» not found when building application project files with CMake and GLFW source #868
  8. Comments

Fatal error pthread h no such file or directory windows

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

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.

Answers

Actually, if #include

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).

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

Источник

fatal error C1083: Cannot open include file: ‘pthread.h’: No such file or directory

I have VS 2017 and add the pthread plugin in my VS 2017. After add pthread, throwing buils error as,
messageloggermessagelogger.sharedmessagelogger.h(30): fatal error C1083: Cannot open include file: ‘pthread.h’: No such file or directory.

Thanks & Regards,
Dileep

Hi Dileep, have you tried my suggestions? Feel free to let me know if you have any update.

I had the same problem as this person, I did as you said and I solved it.

I had the same problem as this person, I did as you said and I solved it.

1 answer

How do you add the pthread plugin to VS 2017? pthread is for Linux POSIX threads and isn’t combined with Visual Studio, you can try to use NuGet packages or Vcpkg to install and use pthread.

For NuGet packages, please launch Visual Studio 2017 and select your project > right-click your project > choose Manage NuGet Packages… > Browse > search and find pthreads > Install.

For Vcpkg, please refer to this document Installation(Vcpkg), and follow steps below to install Vcpkg.

Источник

«pthread.h» not found when building application project files with CMake and GLFW source #868

When I am building my application project files with CMake and GLFW source
(following http://www.glfw.org/docs/latest/build_guide.html#build_link_cmake_source),
I get an error at line target_link_libraries($ glfw) . If I remove this line, project files will build, but won’t link glfw.
It seems cmake is trying to find a pthread.h

$PATH:i :VCEnd CMAKE_C_COMPILER=C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64cl.exe FinalizeBuildStatus: Deleting file «DebugCompilerIdC.tlogunsuccessfulbuild». Touching «DebugCompilerIdC.tlogCompilerIdC.lastbuildstate». Done Building Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFiles3.6.2CompilerIdCCompilerIdC.vcxproj» (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.51 Compilation of the C compiler identification source «CMakeCCompilerId.c» produced «CompilerIdC.exe» Compilation of the C compiler identification source «CMakeCCompilerId.c» produced «CompilerIdC.vcxproj» The C compiler identification is MSVC, found in «C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/3.6.2/CompilerIdC/CompilerIdC.exe» Compiling the CXX compiler identification source file «CMakeCXXCompilerId.cpp» succeeded. Compiler: Build flags: Id flags: The output was: 0 Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. Build started 9/25/2016 2:39:36 PM. Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFiles3.6.2CompilerIdCXXCompilerIdCXX.vcxproj» on node 1 (default targets). PrepareForBuild: Creating directory «Debug». Creating directory «DebugCompilerIdCXX.tlog». InitializeBuildStatus: Creating «DebugCompilerIdCXX.tlogunsuccessfulbuild» because «AlwaysCreate» was specified. ClCompile: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64CL.exe /c /nologo /W0 /WX- /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo»Debug\» /Fd»Debugvc140.pdb» /Gd /TP /errorReport:queue CMakeCXXCompilerId.cpp CMakeCXXCompilerId.cpp Link: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64link.exe /ERRORREPORT:QUEUE /OUT:».CompilerIdCXX.exe» /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:»level=’asInvoker’ uiAccess=’false’» /manifest:embed /PDB:».CompilerIdCXX.pdb» /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:».CompilerIdCXX.lib» /MACHINE:X64 DebugCMakeCXXCompilerId.obj CompilerIdCXX.vcxproj -> C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFiles3.6.2CompilerIdCXX.CompilerIdCXX.exe PostBuildEvent: for %%i in (cl.exe) do @echo CMAKE_CXX_COMPILER=%%

$PATH:i :VCEnd CMAKE_CXX_COMPILER=C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64cl.exe FinalizeBuildStatus: Deleting file «DebugCompilerIdCXX.tlogunsuccessfulbuild». Touching «DebugCompilerIdCXX.tlogCompilerIdCXX.lastbuildstate». Done Building Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFiles3.6.2CompilerIdCXXCompilerIdCXX.vcxproj» (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.49 Compilation of the CXX compiler identification source «CMakeCXXCompilerId.cpp» produced «CompilerIdCXX.exe» Compilation of the CXX compiler identification source «CMakeCXXCompilerId.cpp» produced «CompilerIdCXX.vcxproj» The CXX compiler identification is MSVC, found in «C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/3.6.2/CompilerIdCXX/CompilerIdCXX.exe» Determining if the C compiler works passed with the following output: Change Dir: C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp Run Build Command:»C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe» «cmTC_45bed.vcxproj» «/p:Configuration=Debug» «/p:VisualStudioVersion=14.0» Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. Build started 9/25/2016 2:39:37 PM. Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_45bed.vcxproj» on node 1 (default targets). PrepareForBuild: Creating directory «cmTC_45bed.dirDebug». Creating directory «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebug». Creating directory «cmTC_45bed.dirDebugcmTC_45bed.tlog». InitializeBuildStatus: Creating «cmTC_45bed.dirDebugcmTC_45bed.tlogunsuccessfulbuild» because «AlwaysCreate» was specified. ClCompile: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo»cmTC_45bed.dirDebug\» /Fd»cmTC_45bed.dirDebugvc140.pdb» /Gd /TC /errorReport:queue C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmptestCCompiler.c Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo»cmTC_45bed.dirDebug\» /Fd»cmTC_45bed.dirDebugvc140.pdb» /Gd /TC /errorReport:queue C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmptestCCompiler.c testCCompiler.c Link: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64link.exe /ERRORREPORT:QUEUE /OUT:»C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_45bed.exe» /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:»level=’asInvoker’ uiAccess=’false’» /manifest:embed /DEBUG /PDB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_45bed.pdb» /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_45bed.lib» /MACHINE:X64 /machine:x64 cmTC_45bed.dirDebugtestCCompiler.obj cmTC_45bed.vcxproj -> C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_45bed.exe FinalizeBuildStatus: Deleting file «cmTC_45bed.dirDebugcmTC_45bed.tlogunsuccessfulbuild». Touching «cmTC_45bed.dirDebugcmTC_45bed.tlogcmTC_45bed.lastbuildstate». Done Building Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_45bed.vcxproj» (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.90 Detecting C compiler ABI info compiled with the following output: Change Dir: C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp Run Build Command:»C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe» «cmTC_d2761.vcxproj» «/p:Configuration=Debug» «/p:VisualStudioVersion=14.0» Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. Build started 9/25/2016 2:39:38 PM. Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_d2761.vcxproj» on node 1 (default targets). PrepareForBuild: Creating directory «cmTC_d2761.dirDebug». Creating directory «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebug». Creating directory «cmTC_d2761.dirDebugcmTC_d2761.tlog». InitializeBuildStatus: Creating «cmTC_d2761.dirDebugcmTC_d2761.tlogunsuccessfulbuild» because «AlwaysCreate» was specified. ClCompile: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo»cmTC_d2761.dirDebug\» /Fd»cmTC_d2761.dirDebugvc140.pdb» /Gd /TC /errorReport:queue «C:Program FilesCMakesharecmake-3.6ModulesCMakeCCompilerABI.c» Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo»cmTC_d2761.dirDebug\» /Fd»cmTC_d2761.dirDebugvc140.pdb» /Gd /TC /errorReport:queue «C:Program FilesCMakesharecmake-3.6ModulesCMakeCCompilerABI.c» CMakeCCompilerABI.c Link: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64link.exe /ERRORREPORT:QUEUE /OUT:»C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_d2761.exe» /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:»level=’asInvoker’ uiAccess=’false’» /manifest:embed /DEBUG /PDB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_d2761.pdb» /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_d2761.lib» /MACHINE:X64 /machine:x64 cmTC_d2761.dirDebugCMakeCCompilerABI.obj cmTC_d2761.vcxproj -> C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_d2761.exe FinalizeBuildStatus: Deleting file «cmTC_d2761.dirDebugcmTC_d2761.tlogunsuccessfulbuild». Touching «cmTC_d2761.dirDebugcmTC_d2761.tlogcmTC_d2761.lastbuildstate». Done Building Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_d2761.vcxproj» (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.59 Determining if the CXX compiler works passed with the following output: Change Dir: C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp Run Build Command:»C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe» «cmTC_a9a92.vcxproj» «/p:Configuration=Debug» «/p:VisualStudioVersion=14.0» Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. Build started 9/25/2016 2:39:39 PM. Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_a9a92.vcxproj» on node 1 (default targets). PrepareForBuild: Creating directory «cmTC_a9a92.dirDebug». Creating directory «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebug». Creating directory «cmTC_a9a92.dirDebugcmTC_a9a92.tlog». InitializeBuildStatus: Creating «cmTC_a9a92.dirDebugcmTC_a9a92.tlogunsuccessfulbuild» because «AlwaysCreate» was specified. ClCompile: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo»cmTC_a9a92.dirDebug\» /Fd»cmTC_a9a92.dirDebugvc140.pdb» /Gd /TP /errorReport:queue C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmptestCXXCompiler.cxx Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo»cmTC_a9a92.dirDebug\» /Fd»cmTC_a9a92.dirDebugvc140.pdb» /Gd /TP /errorReport:queue C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmptestCXXCompiler.cxx testCXXCompiler.cxx Link: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64link.exe /ERRORREPORT:QUEUE /OUT:»C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_a9a92.exe» /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:»level=’asInvoker’ uiAccess=’false’» /manifest:embed /DEBUG /PDB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_a9a92.pdb» /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_a9a92.lib» /MACHINE:X64 /machine:x64 cmTC_a9a92.dirDebugtestCXXCompiler.obj cmTC_a9a92.vcxproj -> C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_a9a92.exe FinalizeBuildStatus: Deleting file «cmTC_a9a92.dirDebugcmTC_a9a92.tlogunsuccessfulbuild». Touching «cmTC_a9a92.dirDebugcmTC_a9a92.tlogcmTC_a9a92.lastbuildstate». Done Building Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_a9a92.vcxproj» (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.56 Detecting CXX compiler ABI info compiled with the following output: Change Dir: C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp Run Build Command:»C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe» «cmTC_ecbff.vcxproj» «/p:Configuration=Debug» «/p:VisualStudioVersion=14.0» Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. Build started 9/25/2016 2:39:39 PM. Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_ecbff.vcxproj» on node 1 (default targets). PrepareForBuild: Creating directory «cmTC_ecbff.dirDebug». Creating directory «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebug». Creating directory «cmTC_ecbff.dirDebugcmTC_ecbff.tlog». InitializeBuildStatus: Creating «cmTC_ecbff.dirDebugcmTC_ecbff.tlogunsuccessfulbuild» because «AlwaysCreate» was specified. ClCompile: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo»cmTC_ecbff.dirDebug\» /Fd»cmTC_ecbff.dirDebugvc140.pdb» /Gd /TP /errorReport:queue «C:Program FilesCMakesharecmake-3.6ModulesCMakeCXXCompilerABI.cpp» Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo»cmTC_ecbff.dirDebug\» /Fd»cmTC_ecbff.dirDebugvc140.pdb» /Gd /TP /errorReport:queue «C:Program FilesCMakesharecmake-3.6ModulesCMakeCXXCompilerABI.cpp» CMakeCXXCompilerABI.cpp Link: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64link.exe /ERRORREPORT:QUEUE /OUT:»C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_ecbff.exe» /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:»level=’asInvoker’ uiAccess=’false’» /manifest:embed /DEBUG /PDB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_ecbff.pdb» /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_ecbff.lib» /MACHINE:X64 /machine:x64 cmTC_ecbff.dirDebugCMakeCXXCompilerABI.obj cmTC_ecbff.vcxproj -> C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_ecbff.exe FinalizeBuildStatus: Deleting file «cmTC_ecbff.dirDebugcmTC_ecbff.tlogunsuccessfulbuild». Touching «cmTC_ecbff.dirDebugcmTC_ecbff.tlogcmTC_ecbff.lastbuildstate». Done Building Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_ecbff.vcxproj» (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.56 Detecting CXX [] compiler features compiled with the following output: Change Dir: C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp Run Build Command:»C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe» «cmTC_0e605.vcxproj» «/p:Configuration=Debug» «/p:VisualStudioVersion=14.0» Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. Build started 9/25/2016 2:39:40 PM. Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_0e605.vcxproj» on node 1 (default targets). PrepareForBuild: Creating directory «cmTC_0e605.dirDebug». Creating directory «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebug». Creating directory «cmTC_0e605.dirDebugcmTC_0e605.tlog». InitializeBuildStatus: Creating «cmTC_0e605.dirDebugcmTC_0e605.tlogunsuccessfulbuild» because «AlwaysCreate» was specified. ClCompile: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo»cmTC_0e605.dirDebug\» /Fd»cmTC_0e605.dirDebugvc140.pdb» /Gd /TP /errorReport:queue C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesfeature_tests.cxx Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D «CMAKE_INTDIR=»Debug»» /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo»cmTC_0e605.dirDebug\» /Fd»cmTC_0e605.dirDebugvc140.pdb» /Gd /TP /errorReport:queue C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesfeature_tests.cxx feature_tests.cxx Link: C:Program Files (x86)Microsoft Visual Studio 14.0VCbinx86_amd64link.exe /ERRORREPORT:QUEUE /OUT:»C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_0e605.exe» /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:»level=’asInvoker’ uiAccess=’false’» /manifest:embed /DEBUG /PDB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_0e605.pdb» /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:»C:/Windy/projects/GitHub/Vulkan_HelloWorld/build/CMakeFiles/CMakeTmp/Debug/cmTC_0e605.lib» /MACHINE:X64 /machine:x64 cmTC_0e605.dirDebugfeature_tests.obj cmTC_0e605.vcxproj -> C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpDebugcmTC_0e605.exe FinalizeBuildStatus: Deleting file «cmTC_0e605.dirDebugcmTC_0e605.tlogunsuccessfulbuild». Touching «cmTC_0e605.dirDebugcmTC_0e605.tlogcmTC_0e605.lastbuildstate». Done Building Project «C:WindyprojectsGitHubVulkan_HelloWorldbuildCMakeFilesCMakeTmpcmTC_0e605.vcxproj» (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.56 Feature record: CXX_FEATURE:1cxx_alias_templates Feature record: CXX_FEATURE:1cxx_alignas Feature record: CXX_FEATURE:1cxx_alignof Feature record: CXX_FEATURE:1cxx_attributes Feature record: CXX_FEATURE:1cxx_attribute_deprecated Feature record: CXX_FEATURE:1cxx_auto_type Feature record: CXX_FEATURE:1cxx_binary_literals Feature record: CXX_FEATURE:1cxx_constexpr Feature record: CXX_FEATURE:1cxx_contextual_conversions Feature record: CXX_FEATURE:1cxx_decltype Feature record: CXX_FEATURE:1cxx_decltype_auto Feature record: CXX_FEATURE:1cxx_default_function_template_args Feature record: CXX_FEATURE:1cxx_defaulted_functions Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers Feature record: CXX_FEATURE:1cxx_delegating_constructors Feature record: CXX_FEATURE:1cxx_deleted_functions Feature record: CXX_FEATURE:1cxx_digit_separators Feature record: CXX_FEATURE:1cxx_enum_forward_declarations Feature record: CXX_FEATURE:1cxx_explicit_conversions Feature record: CXX_FEATURE:1cxx_extended_friend_declarations Feature record: CXX_FEATURE:1cxx_extern_templates Feature record: CXX_FEATURE:1cxx_final Feature record: CXX_FEATURE:1cxx_func_identifier Feature record: CXX_FEATURE:1cxx_generalized_initializers Feature record: CXX_FEATURE:1cxx_generic_lambdas Feature record: CXX_FEATURE:1cxx_inheriting_constructors Feature record: CXX_FEATURE:1cxx_inline_namespaces Feature record: CXX_FEATURE:1cxx_lambdas Feature record: CXX_FEATURE:1cxx_lambda_init_captures Feature record: CXX_FEATURE:1cxx_local_type_template_args Feature record: CXX_FEATURE:1cxx_long_long_type Feature record: CXX_FEATURE:1cxx_noexcept Feature record: CXX_FEATURE:1cxx_nonstatic_member_init Feature record: CXX_FEATURE:1cxx_nullptr Feature record: CXX_FEATURE:1cxx_override Feature record: CXX_FEATURE:1cxx_range_for Feature record: CXX_FEATURE:1cxx_raw_string_literals Feature record: CXX_FEATURE:1cxx_reference_qualified_functions Feature record: CXX_FEATURE:1cxx_return_type_deduction Feature record: CXX_FEATURE:1cxx_right_angle_brackets Feature record: CXX_FEATURE:1cxx_rvalue_references Feature record: CXX_FEATURE:1cxx_sizeof_member Feature record: CXX_FEATURE:1cxx_static_assert Feature record: CXX_FEATURE:1cxx_strong_enums Feature record: CXX_FEATURE:1cxx_template_template_parameters Feature record: CXX_FEATURE:1cxx_thread_local Feature record: CXX_FEATURE:1cxx_trailing_return_types Feature record: CXX_FEATURE:1cxx_unicode_literals Feature record: CXX_FEATURE:1cxx_uniform_initialization Feature record: CXX_FEATURE:1cxx_unrestricted_unions Feature record: CXX_FEATURE:1cxx_user_literals Feature record: CXX_FEATURE:1cxx_variable_templates Feature record: CXX_FEATURE:1cxx_variadic_macros Feature record: CXX_FEATURE:1cxx_variadic_templates «>

The text was updated successfully, but these errors were encountered:

Источник

  • Remove From My Forums

 locked

fatal error: C1083 : can not open include file «pthread.h» : No such file or directory

  • 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.

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

    • Edited by

      Thursday, March 14, 2013 10:39 PM

    • Marked as answer by
      Elegentin Xie
      Thursday, March 21, 2013 10:26 AM

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

amicoleo opened this issue

Apr 2, 2014

· 6 comments

Comments

@amicoleo

Hi,
I have CB::12.11 and OF 0.8 on a freshly installed Win7 computer.

ofxPd examples didn’t compile because of pthread.h missing. Had a quick research (here too https://github.com/danomatika/ofxPd/issues/new) and had it to compile with this workaround. Not the cleanest solution, but hei! It worked.

  1. Copy pthread.h and sched.h into MinGW/include (I’ve got the files from here ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-1-10-0-release/include/)
  2. Get libpthreadGC1.a from ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-1-10-0-release/lib/ rename it to libpthread.a and copy into MinGW/lib
  3. Get pthreadGC1.dll again from ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-1-10-0-release/lib/ and copy it into MinGW/bin

@danomatika

Actually, this is a problem with the CB+MinGW package which doesn’t include pthread and a few other libs. See the OF Code::Blocks IDE Setup guide which is linked on the OF downloads page. Scroll down to e) Add files to MinGW.

You currently need to manually add the libs from the «Additions for Code::Blocks to work with openFrameworks» link.

@amicoleo

I did add the files you mention to MinGW related folders. But they don’t include pthread related libs. It’s the first time I had this issue, didn’t happen with ofxPd on CB 10.5.

@danomatika

Hmm, well I’m hesitant to include pthreads in the addon. I didn’t recall needing this before :P At the very least, I can include your instructions in the readme.

@danomatika

Also, I’m seeing if we can add pthreads to the CB Win additions zip so my original suggestion would work.

@amicoleo

Yeah, adding it on the CB Win addition would be the best :)

2014-04-04 16:16 GMT+02:00 Dan Wilcox notifications@github.com:

Also, I’m seeing if we can add pthreads to the CB Win additions zip so my
original suggestion would work.

Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-39569297
.

@danomatika

This isn’t really an issue with ofxPd directly since pthread should be included with CB on Windows. Closing the issue for now.

2 participants

@danomatika

@amicoleo

See more:

#include <stdio.h>
#include <pthread.h>


void *threadFunc(void *arg)
{
	char *str;
	int i = 0;

	str=(char*)arg;

	while(i < 10 )
	{
		usleep(1);
		printf("threadFunc says: %sn",str);
		++i;
	}

	return NULL;
}

int main(void)
{
	pthread_t pth;		int i = 0;

	
	pthread_create(&pth,NULL,threadFunc,"processing...");

	
	pthread_join(pth, NULL );

	while(i < 10 )
	{
		usleep(1);
		printf("main() is running...n");
		++i;
	}

	return 0;
}

i am working on Dev C++ .. on compilation it say that no such file or directory <pthread.h> .. thus the further identifiers are undeclared .. what should i do ?


If you are working on Windows OS then POSIX threads (hence the pthread.h header) are NOT available: you have to use Win32 API threading functions (like, for instance CreateThread[^]).

Hi,

pthreads is an open-source POSIX thread library: POSIX Threads[^].

You can fix your compilation error by downloading the pre-compiled binaries. You would need to add the header files into your project and place the lib somewhere in your lib path.

Best Wishes,
-David Delaune

You can compile the same code in Linux machine and you don’t get any compilation error for including the <pthread.h> file.

Regards,
Jauhar

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900


  1. Home


  2. Qt Development


  3. Tools


  4. pthread.h on windows

⚠️ Forum Maintenance: Feb 6th, 8am — 14pm (UTC+2)

This topic has been deleted. Only users with topic management privileges can see it.


  • I’ve inherited some code and tried to compile using QT 4.2.1
    I assume it compiled previously
    When trying to compile the code I get the following errors:
    error: C1083: Cannot open include file: ‘unistd.h’: No such file or directory
    error: C1083: Cannot open include file: ‘pthread.h’: No such file or directory
    error: C1083: Cannot open include file: ‘sys/time.h’: No such file or directory

    Initial digging suggests I should use Cygwin or MinGW? Any thoughts?

    Thanks for your help!


  • Hi and welcome to devnet,

    Rather MinGW but even so you’re not guaranteed that your project will build without an itch. What is pthread used for ? If the project is already using Qt, QThread is worth checking.

    A side note, you seem to be starting development with a very old version of Qt. You should consider updating to the latest Qt 5 (currently 5.8.0) but if you are locked to Qt 4 then consider updating to the latest and last version which is 4.8.7.


  • @SGaist

    Thanks for your response!
    I’ll check out MinGW and reply back to see if that works.
    Regarding version: I made a mistake there. I am Using the latest version of QT. The 4.2.1 refers to the creator version.

    I will check out QThread. I would like to first get this code running.


pranav_sondhi

Posts: 4
Joined: Tue Jan 22, 2019 8:35 am

Re: fatal error C1083: Cannot open include file: ‘pthread.h’: No such file or directory

Post

by pranav_sondhi » Thu Feb 07, 2019 7:18 pm

reox wrote: ↑Tue Feb 05, 2019 4:10 pm
just save the whole output (stderr + stdout) of cmake somewhere. Usually the problem is visible in the first few hundret lines where all packages are configured and search.

I just used my other workstation to do a clean install using VS2013. Now i am getting a different issue (attached cmake message box output). I also installed a new OpenCASCADE librarry (could fined it only for VS10).

I am getting an error «Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)».

I am not able to find the option «FREECAD_BUILD_DOXYGEN_DOCU» to disable (as per the wiki documentation).

Attachments
cmake output.txt
(4.22 KiB) Downloaded 75 times

alex_znd

Posts: 1
Joined: Sun May 02, 2021 8:05 pm


Re: fatal error C1083: Cannot open include file: ‘pthread.h’: No such file or directory

Post

by alex_znd » Sun May 02, 2021 8:20 pm

I met the similar error, I found the error message – Cannot open include file: ‘pthread.h’ in CMakeError.log. I fix this error by the following. For some reason I found that the wrong value being given to the Environment Variable — FREECAD_LIBPACK_DIR (it’s the folder path of the FreeCAD source code). So I amend the value in the Environment Variable — FREECAD_LIBPACK_DIR to the correct Libpack DIR, and then I click the Configure in CMake GUI again and then the error is gone and fixed.

FreeCAD.png
FreeCAD.png (84.88 KiB) Viewed 1892 times

Понравилась статья? Поделить с друзьями:
  • Pthread dll скачать для windows 10 64 bit
  • Ptc hostid как узнать на windows 10
  • Pt170usb premium touch драйвер windows 7
  • Psyx visual c скачать для windows 10
  • Psysxloader dll скачать для windows 10