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".

 

In clion inside when reload cmake project, found the error, can not find the library, by looking at the error log and found that the thread is not

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

Question Reference: https: //stackoverflow.com/questions/55445914/cmake-check-symbol-exists-doesnt-work-because-of-missing-pthread

Solve: https: //cmake.org/cmake/help/latest/module/CheckSymbolExists.html

In CMakeLists file line Riga

include(CheckSymbolExists)

-------

solve! ! !

Guess you like

Origin www.cnblogs.com/havain/p/11735986.html