问题描述:ros学习中,一个小插曲,还以为出什么大问题了,真是苦笑不得
CMake Error at hello/CMakeLists.txt:138 (target_link_libraries):
Cannot specify link libraries for target
"hello/opt/ros/noetic/lib/libroscpp.so" which is not built by this project.
-- Configuring incomplete, errors occurred!
See also "/home/jackson/hello_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jackson/hello_ws/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:614:cmake_check_build_system] 错误 1
Invoking "make cmake_check_build_system" failed
解决方案:真的只是粗心,hello后面少加了一个空格,原来没什么大问题,错误如下:
target_link_libraries(hello${catkin_LIBRARIES})
谨以此篇,告诫自己:还是对cmake文件理解不够深刻,希望后面的错误也能得到解决