解决方法:不用解决哈哈
我在进行程序编译的时候,终端出现了如下问题

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr (found version "10.1") 
-- Found SuiteSparse

因为我本身程序进展不顺利,我就以为这个上面有问题
在网上也搜索了很多解决办法,有的是因为我的下面的Found部分有的库没有Found成功而产生问题,添加库即可,但是我的并没有表明有缺失库,还有的说是cmake指令后面需要添加-lpthread,我尝试过后并没有作用,当然,还有的说是cmake的版本问题,这里我查看了我的版本还比较新,于是没有进行更新尝试(也担心有更新失败的风向呐!!!

然后我顺着cmake相关文件查看了错误日志,日志内容

#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}




Run Build Command(s):/usr/bin/make cmTC_90c32/fast && /usr/bin/make -f CMakeFiles/cmTC_90c32.dir/build.make CMakeFiles/cmTC_90c32.dir/build
make[1]: 进入目录“/home/csl/wenjin/ElasticFusion/Core/build/CMakeFiles/CMakeTmp”
Building C object CMakeFiles/cmTC_90c32.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_90c32.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_90c32
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_90c32.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_90c32.dir/CheckFunctionExists.c.o  -o cmTC_90c32  -lpthreads 
/usr/bin/ld: 找不到 -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_90c32.dir/build.make:87:cmTC_90c32] 错误 1
make[1]: 离开目录“/home/csl/wenjin/ElasticFusion/Core/build/CMakeFiles/CMakeTmp”
make: *** [Makefile:121:cmTC_90c32/fast] 错误 2

我其实还觉得有问题,我在相关论坛进行提问,得到如下回答:
在这里插入图片描述
在这里插入图片描述
所以如果程序还不能进展下去,可以往其他的方向考虑啦,不是这个的问题,并且有博主相关程序是这个,并没有影响他的程序进行。

所以请安心查找其他的问题吧!!!

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐