首页 > 其他 > 详细

Unknown CMake command "check_symbol_exists".

时间:2019-10-25 09:16:18      阅读:145      评论:0      收藏:0      [点我收藏+]

- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at CMakeLists.txt:59 (check_symbol_exists):
  Unknown CMake command "check_symbol_exists".

-- Configuring incomplete, errors occurred!
See also "/home/ht/catkin_ws/src/navigation/amcl/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/ht/catkin_ws/src/navigation/amcl/cmake-build-debug/CMakeFiles/CMakeError.log".

 

在clion里面reload cmake project时,发现报错,找不到该库,通过查看error日志,发现是线程没有

CMakeFiles/cmTC_1a3f9.dir/src.c.o: In function `main‘:
src.c:(.text+0x3c): undefined reference to `pthread_create‘
src.c:(.text+0x48): undefined reference to `pthread_detach‘
src.c:(.text+0x59): undefined reference to `pthread_join‘
src.c:(.text+0x6d): undefined reference to `pthread_atfork‘
collect2: error: ld returned 1 exit status

问题参考:https://stackoverflow.com/questions/55445914/cmake-check-symbol-exists-doesnt-work-because-of-missing-pthread

解决:https://cmake.org/cmake/help/latest/module/CheckSymbolExists.html

在CMakeLists文件里加一行

include(CheckSymbolExists)

-------

解决!!!

Unknown CMake command "check_symbol_exists".

原文:https://www.cnblogs.com/havain/p/11735986.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!