gpt4 book ai didi

opencv - 由于 FFmpeg,如何解决 Ubuntu 11.10 上的 OpenCV 2.3.1 编译错误

转载 作者:太空宇宙 更新时间:2023-11-03 21:09:34 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
compile opencv2.3.1 in ubuntu 11.10

如何准备环境才能在 Ubuntu 11.10 上正确编译 OpenCV 2.3.1?

我正在关注 OpenCV install guide ,但它的说明复杂得令人沮丧。

但是,我将其提炼成以下脚本:

sudo apt-get install --yes cmake libjpeg62 libjpeg62-dev libtiff4 libtiff4-dev libjasper1 libjasper-dev libpng12-0 libpng12-dev libavformat-dev libswscale-dev openexr zlibc zlib1g zlib1g-dev python2.7-dev libgtk-3-dev gcc g++ libtbb-dev
cd /tmp
wget --output-document=OpenCV-2.3.1a.tar.bz2 http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2/download?use_mirror=iweb
tar -xvjf OpenCV-2.3.1a.tar.bz2
cd OpenCV-2.3.1
mkdir release
cd release
time cmake -D WITH_TBB=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
time make

一切都运行成功,当然 make 除外,它退出时出现错误:

/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1339:41: error: ‘guess_format’ was not declared in this scope
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1367:31: error: ‘av_alloc_format_context’ was not declared in this scope
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1411:9: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1363) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1411:35: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1363) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1415:5: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1485) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1415:35: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1485) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1442:15: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3650) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1442:36: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3650) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1479:13: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avio.h:278) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1479:52: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/include/libavformat/avio.h:278) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1485:5: warning: ‘int av_write_header(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1421) [-Wdeprecated-declarations]
/tmp/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1485:25: warning: ‘int av_write_header(AVFormatContext*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1421) [-Wdeprecated-declarations]
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2

如何解决此错误?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com