嘿我试图在基本操作系统(基于Ubuntu)上使用OpenCV Lib.
我按照本教程:
https://www.youtube.com/watch?v=i1K9rXiei9I
我将这些行添加到CmakeList.txt:
find_package(OpenCV required) include_directories(${OpenCV_INCLUDE_DIRS}) target_link_libraries(myOpenCVTest ${OpenCV_LIBS})
但是,当我构建项目时,它失败了一些错误,如:
/usr/bin/ld: cannot find -lopencv_core ...
谁能帮我???
解决方法
我解决了这个问题.
之后我按照这个guide来安装OpenCV和所有必需的软件包.
现在一切都在使用这个CmakeList.txt:
cmake_minimum_required(VERSION 2.8.4) project(OpenCVTest) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") find_package( OpenCV required ) set(SOURCE_FILES main.cpp) add_executable(OpenCVTest ${SOURCE_FILES}) include_directories(${OpenCV_INCLUDE_DIRS}) target_link_libraries( OpenCVTest ${OpenCV_LIBS} )