我下载了opencv-3.2.0.zip
的Linux版本,并使用cmake
命令成功安装。
cmake -D CMake_BUILD_TYPE=RELEASE_INSTALL_PREFIX=/usr/opencv ..
ippicv_linux_20151201.tgz
安装目录下载的 opencv-3.2.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e
。
测试以下问题:
[ 50%] Building CXX object CMakeFiles/hello.dir/hello.cpp.o
make[2]: *** No rule to make target `/workspace/SDKs/opencv-3.2.0/build/lib/libopencv_core.so.3.2.0', needed by `hello'. Stop.
make[1]: *** [CMakeFiles/hello.dir/all] Error 2
make: *** [all] Error 2
的CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(opencvTest)
set(OpenCV_DIR ../opencv-3.2.0/build)
find_package(OpenCV REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( hello hello.cpp )
target_link_libraries( hello ${OpenCV_LIBS} )
hellp.cpp
#include<cv.h>
int main(){
return 0;
}
文件夹名称为opencvTest
,文件夹下有hello.cpp
和CMakeLists.txt
。使用cmake .
和make
命令后会出现上述问题。