2012-07-19 52 views
3

我試着在兩個mac中編譯OpenCSV,並且都出現錯誤。錯誤如下:在macos錯誤上編譯opencv - libavformat中的錯誤

Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o 
use of undeclared identifier 'avformat_find_stream_info'; 
did you mean 'av_find_stream_info'? 
/usr/local/include/libavformat/avformat.h:1168:5: note: 'av_find_stream_info' declared here int av_find_stream_info(AVFormatContext *ic); 

/usr/local/include中的libavformat與ffmpeg一起安裝。 Ffmpeg是0.8.5版本

任何人都有這個相同的問題?

+0

opencsv是一個用逗號分隔值解析文件的Java庫。你的意思是計算機視覺庫OpenCV? – blahdiblah 2012-07-19 21:28:38

+0

是的,我做過。那是一個錯字。 – Sofia 2012-07-20 19:12:11

回答

2

我基本編輯的代碼模塊/ highgui/SRC/cap_ffmpeg_impl.hpp從

#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 3, 0) 
    avformat_find_stream_info(ic, NULL); 
#else 
    av_find_stream_info(ic); 
#endif 

#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 3, 0) 
    av_find_stream_info(ic); 
    //avformat_find_stream_info(ic, NULL); 
#else 
    av_find_stream_info(ic); 
#endif 

和解決它。目前沒有問題。

+0

謝謝。同樣的問題,相同版本的ffmpeg,同樣的解決方案工作。 – VaporwareWolf 2013-07-04 06:32:13

1

您可以通過添加以下參數到cmake命令禁止的ffmpeg(見例如this manual):

-DWITH_FFMPEG=OFF 

假設你實際上並不需要的ffmpeg在你的構建,這將擺脫錯誤的。