我想在我的 ubuntu 12.04 中安装 openCV 但是出现以下错误。
[ 45%] Building CXX object src/cxcore/CMakeFiles/cxcore_pch_dephelp.dir/cxcore_pch_dephelp.o
In file included from /home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxcore.h:1826:0,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/src/cxcore/_cxcore.h:51,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/release/src/cxcore/cxcore_pch_dephelp.cxx:1:
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxcore.hpp:177:13: error: ‘ptrdiff_t’ does not name a type
In file included from /home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxcore.hpp:2307:0,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxcore.h:1826,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/src/cxcore/_cxcore.h:51,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/release/src/cxcore/cxcore_pch_dephelp.cxx:1:
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxoperations.hpp:2043:15: error: ‘ptrdiff_t’ does not name a type
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxoperations.hpp:2591:31: error: ‘ptrdiff_t’ does not name a type
In file included from /home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxcore.hpp:2308:0,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxcore.h:1826,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/src/cxcore/_cxcore.h:51,
from /home/michael/Downloads/open cv/OpenCV-2.1.0/release/src/cxcore/cxcore_pch_dephelp.cxx:1:
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp: In member function ‘void cv::Mat::locateROI(cv::Size&, cv::Point&) const’:
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:387:5: error: ‘ptrdiff_t’ was not declared in this scope
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:387:5: note: suggested alternatives:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/i686-pc-linux-gnu/bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/i686-pc-linux-gnu/bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:387:15: error: expected ‘;’ before ‘delta1’
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:389:9: error: ‘delta1’ was not declared in this scope
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:398:31: error: ‘delta2’ was not declared in this scope
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp: In member function ‘cv::Point cv::MatConstIterator_::pos() const’:
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3459:9: error: ‘ptrdiff_t’ was not declared in this scope
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3459:9: note: suggested alternatives:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/i686-pc-linux-gnu/bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/i686-pc-linux-gnu/bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3459:19: error: expected ‘;’ before ‘ofs’
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3460:23: error: ‘ofs’ was not declared in this scope
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3460:66: error: expected ‘)’ before ‘y’
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3465:9: error: ‘ptrdiff_t’ was not declared in this scope
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3465:9: note: suggested alternatives:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/i686-pc-linux-gnu/bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.6.1/../../../../include/c++/4.6.1/i686-pc-linux-gnu/bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3465:19: error: expected ‘;’ before ‘ofs’
/home/michael/Downloads/open cv/OpenCV-2.1.0/include/opencv/cxmat.hpp:3466:23: error: ‘ofs’ was not declared in this scope
make[2]: *** [src/cxcore/CMakeFiles/cxcore_pch_dephelp.dir/cxcore_pch_dephelp.o] Error 1
make[1]: *** [src/cxcore/CMakeFiles/cxcore_pch_dephelp.dir/all] Error 2
make: *** [all] Error 2
我尝试添加#include <stddef.h>
cxcore.hpp,但出现此错误
[ 45%] Built target opencv_lapack
[ 45%] Building CXX object src/cxcore/CMakeFiles/cxcore_pch_dephelp.dir/cxcore_pch_dephelp.o
Linking CXX static library ../../lib/libcxcore_pch_dephelp.a
[ 45%] Built target cxcore_pch_dephelp
Scanning dependencies of target pch_Generate_cxcore
[ 45%] Generating _cxcore.h
[ 45%] Generating _cxcore.h.gch/cxcore_RELEASE.gch
c++: error: cv/OpenCV-2.1.0/.: No such file or directory
c++: error: cv/OpenCV-2.1.0/release: No such file or directory
c++: error: cv/OpenCV-2.1.0/include: No such file or directory
c++: error: cv/OpenCV-2.1.0/include/opencv: No such file or directory
c++: error: cv/OpenCV-2.1.0/src/cxcore/../../3rdparty/include: No such file or directory
c++: error: cv/OpenCV-2.1.0/src/cxcore/../../include/opencv: No such file or directory
c++: error: cv/OpenCV-2.1.0/release/src/cxcore: No such file or directory
make[2]: *** [src/cxcore/_cxcore.h.gch/cxcore_RELEASE.gch] Error 1
make[1]: *** [src/cxcore/CMakeFiles/pch_Generate_cxcore.dir/all] Error 2
make: *** [all] Error 2
如何解决这个问题?在 ubuntu 12.04 中无法安装此版本的 openCV。任何帮助都将不胜感激。:)
根据@steeldriver 的评论,我已重命名该文件夹,并且它正常工作。但我收到另一个错误。我使用的是 32 位 Ubuntu 12.04。这些是错误。
[ 61%] Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o
In file included from /usr/include/libavutil/avutil.h:318:0,
from /usr/include/libavutil/samplefmt.h:22,
from /usr/include/libavcodec/avcodec.h:30,
from /usr/include/libavformat/avformat.h:140,
from /home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:97:
/usr/include/libavutil/common.h: In function ‘int32_t av_clipl_int32_c(int64_t)’:
/usr/include/libavutil/common.h:168:47: error: ‘UINT64_C’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual void CvCapture_FFMPEG::close()’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:385:9: warning: ‘void av_close_input_file(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1580) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:385:31: warning: ‘void av_close_input_file(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1580) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘bool CvCapture_FFMPEG::reopen()’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:414:5: warning: ‘void av_close_input_file(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1580) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:414:27: warning: ‘void av_close_input_file(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1580) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:417:5: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1368) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:417:52: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1368) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:418:5: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1412) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:418:27: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1412) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:425:5: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:425:28: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::open(const char*)’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:450:15: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1368) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:450:63: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1368) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:455:11: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1412) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:455:33: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1412) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:467:13: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:470:13: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:470:36: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::grabFrame()’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:548:54: error: ‘avcodec_decode_video’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘const char* icvFFMPEGErrStr(int)’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:801:10: error: ‘AVERROR_NUMEXPECTED’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:805:10: error: ‘AVERROR_NOFMT’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:807:10: error: ‘AVERROR_IO’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:809:10: error: ‘AVERROR_NOMEM’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*, CodecID, int, int, int, double, int)’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:881:7: warning: ‘AVStream* av_new_stream(AVFormatContext*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1604) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:881:26: warning: ‘AVStream* av_new_stream(AVFormatContext*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1604) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:894:70: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, uint8_t*, uint32_t, AVFrame*)’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:993:22: error: ‘PKT_FLAG_KEY’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1008:90: error: ‘av_rescale_q’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1013:30: error: ‘PKT_FLAG_KEY’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual void CvVideoWriter_FFMPEG::close()’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1177:3: warning: ‘int url_fclose(AVIOContext*)’ is deprecated (declared at /usr/include/libavformat/avio.h:317) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1177:20: warning: ‘int url_fclose(AVIOContext*)’ is deprecated (declared at /usr/include/libavformat/avio.h:317) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1210:41: error: ‘guess_format’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1233:31: error: ‘av_alloc_format_context’ was not declared in this scope
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1274:9: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1640) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1274:35: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1640) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1278:5: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1902) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1278:35: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1902) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1303:15: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1303:36: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4035) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1340:13: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avio.h:316) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1340:52: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avio.h:316) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1346:5: warning: ‘int av_write_header(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1676) [-Wdeprecated-declarations]
/home/michael/Downloads/opencv/OpenCV-2.1.0/src/highgui/cvcap_ffmpeg.cpp:1346:25: warning: ‘int av_write_header(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1676) [-Wdeprecated-declarations]
make[2]: *** [src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o] Error 1
make[1]: *** [src/highgui/CMakeFiles/highgui.dir/all] Error 2
make: *** [all] Error 2
我尝试过将其包含<stdint.h>
在 common.h 文件中,但仍然不起作用。或者我在包含文件时做错了<stdint.h>
?请帮忙。
这是make
运行后的结果cmake -DWITH_FFMPEG=OFF
[ 81%] Building CXX object apps/haartraining/CMakeFiles/createsamples.dir/createsamples.o
Linking CXX executable ../../bin/opencv_createsamples
../../lib/libhighgui.so.2.1.0: undefined reference to `cvCreateCameraCapture_V4L(int)'
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_createsamples] Error 1
make[1]: *** [apps/haartraining/CMakeFiles/createsamples.dir/all] Error 2
make: *** [all] Error 2
这是为什么?
答案1
如果你不需要 ffmpeg 功能,那么应该可以使用 Ubuntu 12.04 构建 OpenCV-2.1.0 的其余组件此补丁[dropbox.com]。要应用补丁,请将其复制到与解压后的 OpenCV-2.1.0 目录相同的级别,然后
cd OpenCV-2.1.0/
patch -p1 < ../patch-OpenCV-2.1.0-all.txt
之后应该可以配置和制作剩余的组件
cmake -DWITH_FFMPEG=OFF .
make
我已经在 32 位 12.04.3 上使用 gcc-4.6.3 进行了测试,并且(如果我没记错的话)在 64 位 crunchbang 系统上使用 gcc-4.7 进行了测试(实际上,补丁中的某些更改可能只需要用于 gcc >= 4.7)。受补丁影响的文件是
OpenCV-2.1.0/cvconfig.h.cmake
OpenCV-2.1.0/include/opencv/cxcore.h
OpenCV-2.1.0/src/highgui/cvcap.cpp
OpenCV-2.1.0/src/highgui/cvcap_libv4l.cpp
OpenCV-2.1.0/src/highgui/_highgui.h
OpenCV-2.1.0/tests/cv/src/anearestneighbors.cpp
OpenCV-2.1.0/tests/cxcore/src/aio.cpp
OpenCV-2.1.0/tests/ml/src/slmltests.cpp
不幸的是,ffmpeg 和 libav 之间似乎存在许多复杂的相互依赖关系,这使得修补该组件变得更加困难。
答案2
尝试重新安装
$cd ~/opencv2.4.5
$mkdir build
$cd build
$cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON
现在,您应该使用超级用户或 sudo
$make
$sudo make install
最后测试是否安装成功
$cd ~/opencv2.4.5/samples/c
$g++ `pkg-config --cflags opencv` -o mydelaunay delaunay.c `pkg-config --libs opencv`