Home › Forum › SOFA › Building SOFA › [SOLVED] Determining if the include file pthread.h exists failed
Tagged: building sofa, pthread, SOFA_2012, VS2019, Windows_10
- This topic has 3 replies, 2 voices, and was last updated 3 years, 2 months ago by
matscisteph.
-
AuthorPosts
-
29 June 2021 at 08:03 #19883
matscisteph
BlockedHello!
I am a new to SOFA and am installing everything on Windows 10 according to the instructions outlined here: https://www.sofa-framework.org/community/doc/getting-started/build/windows/
Everything seems ok until I try to configure everything in CMake, where I get the following error from the CMakeError.txt file:
Determining if the include file pthread.h exists failed with the following output: Change Dir: C:/Users/User/sofa/build/CMakeFiles/CMakeTmp Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe cmTC_d838a.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved. Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30038.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_d838a.dir\Debug\\" /Fd"cmTC_d838a.dir\Debug\vc142.pdb" /external:env:EXTERNAL_INCLUDE /external:W3 /Gd /TC /errorReport:queue C:\Users\User\sofa\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c CheckIncludeFile.c C:\Users\User\sofa\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1,10): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [C:\Users\User\sofa\build\CMakeFiles\CMakeTmp\cmTC_d838a.vcxproj]
As far as I can tell pthread is in the correct folder: C:\Users\User\sofa\src\applications\plugins\SensableEmulation\pthread
Could someone please direct me to a solution for this?
Thank you,
29 June 2021 at 17:20 #19895jnbrunet
ModeratorHey @matscisteph
I’m not on Windows unfortunately so I cannot test it, but could you try to replace the following lines in the file
sofa\src\applications\plugins\SensableEmulation\CMakeLists.txt
:set(SOURCE_FILES OmniDriverEmu.cpp initSensableEmulation.cpp )
with
set(SOURCE_FILES OmniDriverEmu.cpp initSensableEmulation.cpp ) if(MSVC) list(APPEND SOURCE_FILES "pthread/pthread.h") endif()
5 July 2021 at 06:14 #19921matscisteph
BlockedThanks @jnbrunet
I put that into the CMakeLists.txt you specified and am still getting the same error. Is there something else I can try?
Here is what my CMakeLists.txt looks like:
include(${SOFA_CMAKE_DIR}/preProject.cmake) set(HEADER_FILES #NewOmniDriverEmu.h OmniDriverEmu.h pthread/pthread.h ) set(SOURCE_FILES OmniDriverEmu.cpp initSensableEmulation.cpp ) if(MSVC) list(APPEND SOURCE_FILES "pthread/pthread.h") endif() set(README_FILES PluginSensableEmulation.txt ) IF(WIN32) set(THREADS_USE_PTHREADS_WIN32 true) ENDIF() find_package(Threads REQUIRED) include_directories(${THREADS_PTHREADS_INCLUDE_DIR}) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) AddCompilerDefinitions("SOFA_BUILD_SENSABLEEMULATIONPLUGIN") AddLinkerDependencies(SofaGuiQt SofaComponentGeneral SofaHaptics ${CMAKE_THREAD_LIBS_INIT}) include(${SOFA_CMAKE_DIR}/postProject.cmake)
Thanks,
5 July 2021 at 17:21 #19935matscisteph
BlockedOk I double checked everything and then changed the path for Qt in my Environment Variables from C:\Qt to C:\Qt\5.15.2\msvc2019_64\bin and that error disappeared. That seems to have solved the issue for now. Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.