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' 原因分析


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值