Unknown CMake command "check_symbol_exists".


- 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)

-------

解決!!!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM