Linux 找不到模块FindOpenCV.cmake
我连接到一个虚拟linux机器,在那里我没有任何特权。。。 我安装了带有Linux 找不到模块FindOpenCV.cmake,linux,opencv,Linux,Opencv,我连接到一个虚拟linux机器,在那里我没有任何特权。。。 我安装了带有 cadenv opencv (非常好……其他人为我做了所有的工作) 现在我尝试运行一个简单的代码来显示图像 #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf
cadenv opencv
(非常好……其他人为我做了所有的工作)
现在我尝试运行一个简单的代码来显示图像
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(int argc, char** argv )
{
if ( argc != 2 )
{
printf("usage: DisplayImage.out <Image_Path>\n");
return -1;
}
Mat image;
image = imread( argv[1], 1 );
if ( !image.data )
{
printf("No image data \n");
return -1;
}
namedWindow("Display Image", CV_WINDOW_AUTOSIZE );
imshow("Display Image", image);
waitKey(0);
return 0;
}
当我运行cmake时。
我明白了
我不知道这个环境,所以我不知道如何告诉Cmake在哪里可以找到它想要的东西。。。
你能帮我吗
谢谢
安装输出
Package OpenCV release 2.4.8 has been installed.
You can now:
- use the commands:
opencv_createsamples, opencv_haartraining,
opencv_performance and opencv_traincascade.
- use pkg-config to obtain information about compiler
and linker flags by placing the directory
/cadappl/opencv/2.4.8/lib/pkgconfig
in the environment variable PKG_CONFIG_PATH and
using package 'opencv' as package name.
- let CMake obtain information about OpenCV from the
files /cadappl/opencv/2.4.8/share/OpenCV/OpenCV*.cmake;
- View sample source files that use OpenCV in the folder
/cadappl/opencv/2.4.8/share/OpenCV/samples and its
subfolders c, cpp, gpu and ocl.
- Use OpenCV from Java 1.7.0 (/usr/bin/java) by using
/cadappl/opencv/2.4.8/share/OpenCV/java/opencv-248.jar
which at requires the shared library
/cadappl/opencv/2.4.8/share/OpenCV/java/libopencv_java248.so
Note: all OpenCV 2.4.8 programs & libraries have been
compiled with the GNU C compiler 4.4.7 (/usr/bin/gcc).
只是好奇,它到底安装了什么?如果没有src树,您可能无法使用cmake。@berak我添加了安装后得到的内容Good!尝试将cmake指向resp。文件夹:cmake-D cmake_MODULE_PATH=/cadappl/opencv/2.4.8/share/opencv我应该在命令行中键入这一行吗?我想是的你以前运行过cmake,它抱怨找不到文件,对吗?只需将这些参数添加到cmake部件,使其能够找到它们
CMake Error at CMakeLists.txt:3 (find_package):
Could not find module FindOpenCV.cmake or a configuration file for package
OpenCV.
Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the
directory containing a CMake configuration file for OpenCV. The file will
have one of the following names:
OpenCVConfig.cmake
opencv-config.cmake
-- Configuring incomplete, errors occurred!
Package OpenCV release 2.4.8 has been installed.
You can now:
- use the commands:
opencv_createsamples, opencv_haartraining,
opencv_performance and opencv_traincascade.
- use pkg-config to obtain information about compiler
and linker flags by placing the directory
/cadappl/opencv/2.4.8/lib/pkgconfig
in the environment variable PKG_CONFIG_PATH and
using package 'opencv' as package name.
- let CMake obtain information about OpenCV from the
files /cadappl/opencv/2.4.8/share/OpenCV/OpenCV*.cmake;
- View sample source files that use OpenCV in the folder
/cadappl/opencv/2.4.8/share/OpenCV/samples and its
subfolders c, cpp, gpu and ocl.
- Use OpenCV from Java 1.7.0 (/usr/bin/java) by using
/cadappl/opencv/2.4.8/share/OpenCV/java/opencv-248.jar
which at requires the shared library
/cadappl/opencv/2.4.8/share/OpenCV/java/libopencv_java248.so
Note: all OpenCV 2.4.8 programs & libraries have been
compiled with the GNU C compiler 4.4.7 (/usr/bin/gcc).