我想构建我的简单OpenCV程序,但是当我构建项目时,它失败并且错误描述是:
No rule to make target `/usr/lib/x86_64-linux-gnu/libconsole_bridge.so,opencv_videostab', needed by `/home/turtlebot/catkin_ws/devel/lib/multi_robot_slam/imageConverter'. Stop.
这是我的CmakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(robot_slam)
find_package(catkin REQUIRED
COMPONENTS
cmake_modules
roscpp
sensor_msgs
cv_bridge
std_msgs
image_transport
)
find_package(OpenCV REQUIRED)
include_directories(include ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
catkin_package()
add_executable(imageConverter src/imageConverter.cpp)
target_link_libraries(imageConverter ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
有谁知道问题是什么以及如何解决?
答案 0 :(得分:0)
我终于通过将逗号修改为空格来解决我的问题。从中我了解到:
No rule to make target /usr/lib/x86_64linux-gnu/libconsole_bridge.so,opencv_videostab', needed by /home/turtlebot/catkin_ws/devel/lib/multi_robot_slam/imageConverter'.Stop.
表示有人通过逗号而不是空格错误地枚举库。
此外,我还解决了
的问题undefined reference to ***.
这些问题通常意味着没有库,或者你的计算机上有多个版本的lib。对我来说,这是因为#include<>
使用了opencv3.2的头文件而opencv2使用了lib .4所以我将find_package(OpenCV REQUIRED)
修改为find_package(OpenCV 3 REQUIRED)
以使lib使用也是opencv3.2。然后所有问题都消失了,一切顺利!