CRY6666 2017-09-07 03:26 采纳率: 0%
浏览 15314

在使用CMake时,遇到pthread.h not found该怎么解决,查了好多资料都没解决。

-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found OpenSSL: C:/xmr-stak-dep/opensslbbeay32.lib (found version "1.0.2
l")
You have called ADD_LIBRARY for library xmr-stak-c without any source files.
This typically indicates a problem with your CMakeLists.txt file
CMake Error at CMakeLists.txt:173 (add_executable):
add_executable called with incorrect number of arguments

CMake Error at CMakeLists.txt:178 (target_link_libraries):
Cannot specify link libraries for target "xmr-stak-cpu" which is not built
by this project.

-- Configuring incomplete, errors occurred!
See also "C:/Users/Administrator/sourceild/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Administrator/sourceild/CMakeFiles/CMakeError.log"

.图片说明

CMAKEError.log内容如下:
Determining if the include file pthread.h exists failed with the following output:
Change Dir: C:/xmr-stak-cpu/CMakeFiles/CMakeTmp

Run Build Command:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional/MSBuild/15.0/Bin/MSBuild.exe" "cmTC_c3038.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
用于 .NET Framework 的 Microsoft (R) 生成引擎版本 15.3.409.57025

版权所有(C) Microsoft Corporation。保留所有权利。

生成启动时间为 2017/9/7 11:08:54。

节点 1 上的项目“C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\cmTC_c3038.vcxproj”(默认目标)。

PrepareForBuild:

正在创建目录“cmTC_c3038.dir\Debug\”。

正在创建目录“C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\Debug\”。

正在创建目录“cmTC_c3038.dir\Debug\cmTC_c3038.tlog\”。

InitializeBuildStatus:

正在创建“cmTC_c3038.dir\Debug\cmTC_c3038.tlog\unsuccessfulbuild”,因为已指定“AlwaysCreate”。

ClCompile:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\CL.exe /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /Oy- /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_c3038.dir\Debug\" /Fd"cmTC_c3038.dir\Debug\vc141.pdb" /Gd /TC /analyze- /errorReport:queue "C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\CheckIncludeFile.c"

用于 x86 的 Microsoft (R) C/C++ 优化编译器 19.11.25507.1 版

版权所有(C) Microsoft Corporation。保留所有权利。

cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /Oy- /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_c3038.dir\Debug\" /Fd"cmTC_c3038.dir\Debug\vc141.pdb" /Gd /TC /analyze- /errorReport:queue "C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\CheckIncludeFile.c"

CheckIncludeFile.c

C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: 无法打开包括文件: “pthread.h”: No such file or directory [C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\cmTC_c3038.vcxproj]

已完成生成项目“C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\cmTC_c3038.vcxproj”(默认目标)的操作 - 失败。

生成失败。

“C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\cmTC_c3038.vcxproj”(默认目标) (1) ->
(ClCompile 目标) ->
C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: 无法打开包括文件: “pthread.h”: No such file or directory [C:\xmr-stak-cpu\CMakeFiles\CMakeTmp\cmTC_c3038.vcxproj]
0 个警告
1 个错误

已用时间 00:00:00.31
?
?
?
?
?
哪位有经验的牛哥指点一下呗???
环境:Win7_64 VS2017 CMAke3.9.1

  • 写回答

5条回答

  • ugproengineer 2022-06-04 09:29
    关注

    有没有大神解决了

    评论

报告相同问题?

悬赏问题

  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器