Windows7 pthread.h not found
Windows7 pthread.h not found
我正在尝试使用cmake在Windows中编译libaws(http://sourceforge.net/projects/libaws/)库。我已经包含了openssl,libxml,libcurl,我正在使用这个命令行。
C:libaws>cmake -G "Visual Studio 10" -DCURL_LIBRARY="C:toolscurl-7.28.1lib" -DCURL_INCLUDE_DIR="C:toolscurl-7.28.1include" -DLIBXML2_LIBRARIES="C:toolslibxml22.7.8.win32lib" -DLIBXML2_INCLUDE_DIR="C:toolslibxml2-2.7.8.win32include" -DPTHREAD_INCLUDE_DIR="C:toolspthreadinclude" ..toolslibaws-0.9.2
--
它会引发以下错误:
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found CURL: C:/tools/curl-7.28.1/lib (found version "7.28.1")
-- Found OpenSSL: optimized;C:/openssl/lib/ssleay32.lib;debug;C:/openssl/lib/ssleay32.lib;optimized;C:/openssl/lib/libeay32.lib;debug;C:/openssl/lib/libeay32.lib (found version "1.0.1c")
-- Found LibXml2: C:/tools/libxml2-2.7.8.win32/lib (found version "2.7.8")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found.
CMake Lists.txt:78 (消息) 中的 CMake 错误: 找不到线程开发标头
我在 C:\tools\pthread\include 中包含 ptherad.h、semaphore.h 等,并将其作为命令行标志提供:-DPTHREAD_INCLUDE_DIR="C:\tools\pthread\include"。在我的CMakeLists.txt中,我添加了
INCLUDE_DIRECTORIES(${PTHREAD_INCLUDE_DIR})
有什么想法吗?
Visual Studio没有附带"pthread"实现。我想你需要使用另一个编译器,比如MinGW。
@jens-a-koch是对的:我的回答不应该被接受!请"不接受",以便我可以删除它。
我相信您的 CMake 查找模块可能没有使用 PTHREAD_INCLUDE_DIR 定义(类似于 drescherjm 所说的what@)。
我遇到了同样的错误,简而言之,解决方案是为Windows安装Git!
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
和在CMakeError中
checkIncludeFile.c(1,1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
CheckIncludeFile.c(1,1): fatal error C1083: #include <pthread.h>
我已经有 github 应用程序,我用它来克隆我的项目,但由于某种原因,CMake 需要 Git for windows,所以如果有人遇到这个问题,这就是在搜索数小时后对我有用的东西
相关文章:
- OpenCV Android C++ imwrite not found
- 解决"ld: library not found for -ltensorflow_framework.2.3.0"
- 加载与引用 .NET DLL 位于同一文件夹中的引用的 .NET DLL 时"Not found"异常
- C++初学者:为什么我的编译器根据我的循环返回"name not found"?
- _BitScanForward64 can not be found
- 使用提升 asio 时出现"resolve: Host not found (authoritative)"异常
- 为什么 VScode 在 .h 文件中显示"'iostream' file not found"?
- 使用自定义 nodejs 插件时的"The specified module could not be found"
- Boost.Python 和导入 dll,"The specified module could not be found"
- 为什么我在" 'X' identifier not found' "上收到错误
- WinDBG适用于从Visual Studio 2015保存的转储,但不适用于任务管理器。显示异常代码"not found"
- "Entry Point Not Found" Azure 中的错误 LightGBM R 包
- TBB_tbb_LIBRARY_DEBUG-NOT FOUND
- 在 Ubuntu 16.04 下运行协程示例会得到"'experimental/coroutine' file not found"
- 在 mongodb c++ 驱动程序中使用声明"not found"
- 如何修复"/bin/sh: bc: command not found"
- CMake,QT Quick & Visual Studio:"qrc:/main.qml:-1 File not found"
- opencv aruco.h not found windows 10 visual studio
- Qt Cmake 错误编译"GuiSupportQt not found"
- 如何在C++的程序中显示Windows的"DLL not found"错误?