CMake Error at robot_vision/CMakeLists.txt:236 (target_link_libraries): Cannot specify link libraries for target "text" which is not built by this project.
时间: 2024-02-16 15:01:29 浏览: 210
这个错误是由于在 CMakeLists.txt 的第 236 行中,你尝试为名为 "text" 的目标指定链接库,但是该目标并不是由当前项目构建的。可能是你在当前的项目中使用了名为 "text" 的外部库。解决方法是检查 CMakeLists.txt 文件中是否正确引用了外部库,并确保该库已正确安装和可用。如果该库不是必需的,你可以尝试删除与它相关的行。
相关问题
ubuntu16.04运行时报错CMake Error at bobac2_description/CMakeLists.txt:147 (add_dependencies): Cannot add target-level dependencies to non-existent target "bobac2_description_node". The add_dependencies works for top-level logical targets created by the add_executable, add_library, or add_custom_target commands. If you want to add file-level dependencies see the DEPENDS option of the add_custom_target and add_custom_command commands. CMake Error at bobac2_description/CMakeLists.txt:150 (target_link_libraries): Cannot specify link libraries for target "bobac2_description_node" which is not built by this project. -- Configuring incomplete, errors occurred! See also "/home/bobac3/ros_workspace/build/CMakeFiles/CMakeOutput.log". See also "/home/bobac3/ros_workspace/build/CMakeFiles/CMakeError.log". Makefile:2796: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1 CMake Error at bobac2_description/CMakeLists.txt:147 (add_dependencies): Cannot add target-level dependencies to non-existent target "bobac2_description_node". The add_dependencies works for top-level logical targets created by the add_executable, add_library, or add_custom_target commands. If you want to add file-level dependencies see the DEPENDS option of the add_custom_target and add_custom_command commands. CMake Error at bobac2_description/CMakeLists.txt:150 (target_link_libraries): Cannot specify link libraries for target "bobac2_description_node" which is not built by this project. -- Configuring incomplete, errors occurred! See also "/home/bobac3/ros_workspace/build/CMakeFiles/CMakeOutput.log". See also "/home/bobac3/ros_workspace/build/CMakeFiles/CMakeError.log". Makefile:2796: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1
这个错误可能是因为在运行CMake时,找不到名为"bobac2_description_node"的目标。这可能是因为在CMakeLists.txt文件中没有正确地定义目标或源文件。您可以检查一下CMakeLists.txt文件中的目标和源文件是否正确定义。另外,您可以尝试清理并重新构建项目,以确保没有编译错误。您也可以查看CMakeError.log和CMakeOutput.log文件,以获取更多关于错误的详细信息。
CMake Error at precise_land/CMakeLists.txt:214 (target_link_libraries): Cannot specify link libraries for target "traj_pub" which is not built by this project. -- Configuring incomplete, errors occurred! See also "/home/ros/catkin_ctr/build/CMakeFiles/CMakeOutput.log". See also "/home/ros/catkin_ctr/build/CMakeFiles/CMakeError.log". make: *** [Makefile:3358:cmake_check_build_system] 错误 1 Invoking "make cmake_check_build_system" failed
这个错误提示是说在 CMakeLists.txt 文件中,你为 `traj_pub` 目标程序指定了链接库,但是该程序并不是由该项目构建的,因此无法指定链接库。
要解决这个问题,你需要在 CMakeLists.txt 文件中添加一个 `add_executable` 命令来创建 `traj_pub` 目标程序。例如,你可以在 CMakeLists.txt 文件中添加以下行:
```
add_executable(traj_pub src/traj_pub.cpp)
```
这将创建一个名为 `traj_pub` 的目标程序,其源文件为 `src/traj_pub.cpp`。
然后,你可以使用 `target_link_libraries` 命令为该目标程序指定链接库。例如,如果你要为 `traj_pub` 目标程序链接 `catkin_LIBRARIES` 库,可以将以下行:
```
target_link_libraries(traj_pub ${catkin_LIBRARIES})
```
添加到 CMakeLists.txt 文件中。
修改完成后,重新运行 `catkin_make` 命令重新编译你的项目即可。
阅读全文