您的位置:首页 > 其它

常用编译链接错误笔记

2017-04-26 10:31 323 查看
1.cmake 链接opencv库时出现以下错误

cmake文件

cmake_minimum_required(VERSION 2.8)
project( PedestrianDetection )
find_package( OpenCV REQUIRED )
add_executable( PedestrianDetection PedestrianDetection.cpp )
target_link_libraries(  ${OpenCV_LIBS} )


错误

CMake Error at CMakeLists.txt:5 (target_link_libraries):

Cannot specify link libraries for target “opencv_videostab” which is not

built by this project.

解决

target_link_libraries( ${OpenCV_LIBS} )

改为

target_link_libraries(PedestrianDetection ${OpenCV_LIBS} )

2.使用ROS 自带的opencv2.4.8 没有nofree.hpp模块

致命错误: opencv2/nonfree/nonfree.hpp:没有那个文件或目录

解决

sudo apt-get update
sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
sudo apt-get update
sudo apt-get install libopencv-nonfree-dev
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: