【问题标题】:how to Compile OpenCV in Linux 11.04如何在 Linux 11.04 中编译 OpenCV
【发布时间】:2012-03-03 16:36:46
【问题描述】:

我正在尝试使用 cmake 编译 OpenCV,但我不断收到以下错误。

[ 73%] Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o
In file included from /usr/include/libavutil/avutil.h:81:0,
from /usr/include/libavcodec/avcodec.h:30,
from /usr/include/libavformat/avformat.h:56,
from /vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:97:
/usr/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’:
/usr/include/libavutil/common.h:154:47: error: ‘UINT64_C’ was not declared in this scope
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp: In       member function ‘virtual bool CvCapture_FFMPEG::grabFrame()’:
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:546:9:   warning: ‘int avcodec_decode_video(AVCodecContext*, AVFrame*, int*, const uint8_t*, int)’ is   deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:548:54:     warning: ‘int avcodec_decode_video(AVCodecContext*, AVFrame*, int*, const uint8_t*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1199:8: warning: ‘AVOutputFormat* guess_format(const char*, const char*, const char*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:787)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1199:41: warning: ‘AVOutputFormat* guess_format(const char*, const char*, const char*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:787)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1213:7: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at    /usr/include/libavformat/avformat.h:947)
/vol/cruk/Packages/irtk_ubuntu1104/vdm108/OpenCV200w/src/highgui/cvcap_ffmpeg.cpp:1213:31: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/libavformat/avformat.h:947)
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

我不知道它为什么这样做。我真的很感激任何建议。

【问题讨论】:

    标签: linux opencv cmake


    【解决方案1】:

    我假设您正在使用 C++ 编译器对其进行编译。如果你这样做了,你应该定义一个__STDC_CONSTANT_MACROS 标志以使整个事情成功编译。

    更多信息:FFMPEG FAQ

    【讨论】:

      【解决方案2】:

      我在尝试安装 ffmpegOpenCV 的支持时遇到了一些问题。

      检查这个 SO 问题:Error in installing Open-CV with ffmpeg:你会发现一些迹象和编译教程的链接。

      【讨论】:

        猜你喜欢
        • 2011-09-18
        • 2012-07-16
        • 1970-01-01
        • 2013-04-04
        • 1970-01-01
        • 1970-01-01
        • 2013-05-23
        • 1970-01-01
        • 2014-03-14
        相关资源
        最近更新 更多