Linux程序make有一个错误:没有规则来制作目标

时间:2017-01-06 02:24:07

标签: c++ linux opencv ubuntu cmake

我下载了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.cppCMakeLists.txt。使用cmake .make命令后会出现上述问题。

0 个答案:

没有答案