OpenCV2.3.1在Ubuntu11.10上编译错误解决方法

在尝试编译OpenCV 2.3.1时遇到了ffmpeg版本过低导致的编译错误。通过删除旧的ffmpeg及相关库,下载最新依赖,并按照特定步骤配置和安装ffmpeg、gstreamer、gtk、libjpeg及v4l-utils,成功解决了编译问题。
摘要由CSDN通过智能技术生成

经过上次介绍Ubuntu 全新编译安装 OpenCV 2.3之后,很快,新的2.3.1又出来了,经不住诱惑,马上试试

但是,不知道大家在编译最新的2.3.1的时候出现错误没,反正我出现错误了,具体编译错误如下:


[ 35%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o
In file included from /home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg.cpp:45:0:
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::reopen()’:
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:486:5: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1050) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:486:52: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1050) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:494:5: warning: ‘int avcodec_thread_init(AVCodecContext*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3611) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:494:50: warning: ‘int avcodec_thread_init(AVCodecContext*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3611) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::open(const char*)’:
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:524:15: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1050) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:524:63: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:1050) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:541:9: warning: ‘int avcodec_thread_init(AVCodecContext*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3611) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:541:54: warning: ‘int avcodec_thread_init(AVCodecContext*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3611) [-Wdeprecated-declarations]
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp:547:13: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
/home/xizhibei/OpenCV2.3.1/release/CMakeExternals/Source/OpenCV/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::grabFrame()’:
/home/xizhibei/OpenCV2.3.1/release
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值