DLNA之 Error, can't findlibavformat ! 解決方法

DLNA庫版本爲libdlna-0.2.4


執行./configure出錯:

------------------------------

Error, can't findlibavformat !

 --------------------------------------------

 

查看config.log文件:

----------------------------------------------------------

/usr/local/lib/libavformat.a(rtp.o):In function `ff_rtp_get_payload_type':

/home/won/Downloads/ffmpeg/libavformat/rtp.c:99:undefined reference to `av_opt_get_int'

/home/won/Downloads/ffmpeg/libavformat/rtp.c:109:undefined reference to `av_opt_flag_is_set'

/usr/local/lib/libavformat.a(rtp.o):In function `ff_rtp_codec_id':

/home/won/Downloads/ffmpeg/libavformat/rtp.c:148:undefined reference to `av_strcasecmp'

collect2: ldreturned 1 exit status

Error, can't findlibavformat !

------------------------------------

 

用pkg-config命令查下avformat庫使用的共享庫的鏈接CFLAGS:

-------------------------------------------------------------

 $pkg-config libavformat --libs

-pthread-L/usr/local/lib -lavformat -lavcodec -lswresample -lavutil -lrt -lm

 -------------------------------------------------------------

關於pkg-config命令我也是剛接觸,關於它的原理的用法,可以看下pkg-config的用法



修改configure(加上紅色部分的這些庫):

-------------------------------------------------------------

echolog"Checking for libavformat ..."

check_liblibavformat/avformat.h av_register_all -lavformat-pthread -lavformat -lavcodec -lswresample -lavutil -lrt -lm|| die"Error, can't find libavformat !"

echolog"Checking for libavcodec ..."

---------------------------------------------------------------

 

再執行./configure,問題解決。

 

執行make的出錯信息:

--------------------------------------------------------------

gcc test-libdlna.c-W -Wall -Wno-unused-but-set-variable -D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS=64 -D_REENTRANT -O3 -Isrc -Lsrc -ldlna -lavformat -pthread -lavcodec -lswresample -lavutil -lrt-lm -o test-libdlna

src/libdlna.so:undefined reference to `av_close_input_file'

src/libdlna.so:undefined reference to `av_find_stream_info'

collect2: ldreturned 1 exit status

make: ***[test-libdlna] Error 1

--------------------------------------------------------------


解決方法:undefined reference to `av_close_input_file' 原因分析


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章