我最近試圖編譯使用FFmpeg庫的C代碼;但是,由於我無法確定的原因,彙編失敗。使用FFmpeg庫的C代碼 - 編譯錯誤
,我一直在試圖編譯的代碼是Doxygen文檔網站的FFmpeg的filtering_audio.c文件(我會提供的鏈接,因爲代碼太長,在這裏引用):http://ffmpeg.org/doxygen/trunk/doc_2examples_2filtering_audio_8c-example.html
我用gcc來編譯代碼:
gcc filter.c -lavformat -lavcodec -lavfilter -lavutil
而且我得到以下未定義的引用錯誤:
/tmp/cc90K2S5.o: In function `init_filters':
filter.c:(.text+0x3e5): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x407): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x42d): undefined reference to `av_opt_set_bin'
filter.c:(.text+0x482): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x4a4): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x4ca): undefined reference to `av_opt_set_bin'
filter.c:(.text+0x51f): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x541): undefined reference to `av_int_list_length_for_size'
filter.c:(.text+0x567): undefined reference to `av_opt_set_bin'
/tmp/cc90K2S5.o: In function `print_frame':
filter.c:(.text+0x76b): undefined reference to `av_frame_get_channel_layout'
/tmp/cc90K2S5.o: In function `main':
filter.c:(.text+0x831): undefined reference to `av_frame_alloc'
filter.c:(.text+0x83d): undefined reference to `av_frame_alloc'
filter.c:(.text+0x9de): undefined reference to `av_buffersrc_add_frame_flags'
filter.c:(.text+0xa16): undefined reference to `av_buffersink_get_frame'
filter.c:(.text+0xa58): undefined reference to `av_frame_unref'
filter.c:(.text+0xab6): undefined reference to `av_frame_free'
filter.c:(.text+0xac5): undefined reference to `av_frame_free'
collect2: error: ld returned 1 exit status
我明白ŧ未定義的引用錯誤表明它無法找到從filtering_audio.c引用的函數,但這沒有意義,因爲這些函數應該存在於FFmpeg庫中。
任何幫助表示讚賞,謝謝!
我試着與你建議的庫列表鏈接,但我仍然得到同樣的錯誤。假設存儲庫提供最新版本,我已經使用apt-get安裝了所有最新的庫。 如果有幫助,我使用ffmpeg版本N-53766-g09d6bee。我今天剛剛從他們的存儲庫中取出。 – Ardatr