日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

【FFMPEG】【ARM-Linux开发】 ffmpeg 静态库使用,undefined reference错误

發布時間:2025/3/15 linux 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【FFMPEG】【ARM-Linux开发】 ffmpeg 静态库使用,undefined reference错误 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

原文:http://blog.csdn.net/chinazjn/article/details/7954984

ffmpeg移植到dm365上,遇到undefined reference錯誤:

GA/gabin/lib/libavformat.a(allformats.o): In function `av_register_all':
/GA/ffmpeg-0.10/libavformat/allformats.c:53: undefined reference to `avcodec_register_all'
/GA/gabin/lib/libavformat.a(amr.o): In function `amr_read_packet':
/GA/ffmpeg-0.10/libavformat/amr.c:153: undefined reference to `av_new_packet'
/GA/ffmpeg-0.10/libavformat/amr.c:169: undefined reference to `av_free_packet'
/GA/gabin/lib/libavformat.a(anm.o): In function `read_header':
/GA/ffmpeg-0.10/libavformat/anm.c:89: undefined reference to `av_log_ask_for_sample'
/GA/ffmpeg-0.10/libavformat/anm.c:166: undefined reference to `av_log_ask_for_sample'
/GA/gabin/lib/libavformat.a(ape.o): In function `ape_read_packet':
/GA/ffmpeg-0.10/libavformat/ape.c:372: undefined reference to `av_new_packet'
/GA/gabin/lib/libavformat.a(applehttp.o): In function `free_variant_list':
/GA/ffmpeg-0.10/libavformat/applehttp.c:131: undefined reference to `av_free_packet'
/GA/gabin/lib/libavformat.a(applehttp.o): In function `reset_packet':
/GA/ffmpeg-0.10/libavformat/applehttp.c:151: undefined reference to `av_init_packet'
/GA/ffmpeg-0.10/libavformat/applehttp.c:151: undefined reference to `av_init_packet'
/GA/gabin/lib/libavformat.a(applehttp.o): In function `applehttp_read_seek':
/GA/ffmpeg-0.10/libavformat/applehttp.c:712: undefined reference to `av_free_packet'
/GA/gabin/lib/libavformat.a(applehttp.o): In function `reset_packet':


網上查閱,普遍提示兩種解決方法:

一、ffmpeg是純C的庫,應用程序用C++來編譯。

二、路徑、需要的庫包含不全。

以上具體就不說了,搜索下便是。

我在無數遍仔細確認上述兩種可能性后,仍然報錯。郁悶了一個晚上。。

后來查閱ffmpeg的 pkg-config,終于找到原因,錯誤導致過程讓我痛苦,原因卻很簡單。

錯誤:gcc? test.c -o test -I/GA/gabin/include/ -L/GA/gabin/lib??-lavcodec -lavformat? -lavdevice?-lavutil -pthread? -ldl -lswscale -lSDL -lbz2? -lasound -lz -lm ?

調整: gcc? test.c -o test -I/GA/gabin/include/ -L/GA/gabin/lib??-lavformat? -lavdevice?-lavcodec??-lavutil -pthread? -ldl -lswscale -lSDL -lbz2? -lasound -lz -lm??

問題解決,同志需要注意包依賴關系。

轉載于:https://www.cnblogs.com/huty/p/8517568.html

總結

以上是生活随笔為你收集整理的【FFMPEG】【ARM-Linux开发】 ffmpeg 静态库使用,undefined reference错误的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。