cmake链接ffmpeg静态链接库 undefined reference错误

利用cmake生成makefile文件编译项目时出现undefined reference错误,导致编译失败,经网上资料的查询可知需要调整ffmpeg库的连接顺序libavformat、libavdevice、libavcodec、libavutil、libpthread、libswscale、libswresample。

完成顺序调整后,如果仍出现以下报错,则说明未将libswresample链接至程序文件,导致报错。

/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_subpacket':
../ffmpeg/libavcodec/opusdec.c:346: undefined reference to `swr_is_initialized'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_frame':
../ffmpeg/libavcodec/opusdec.c:187: undefined reference to `swr_is_initialized'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_init_resample':
../ffmpeg/libavcodec/opusdec.c:135: undefined reference to `swr_init'
../ffmpeg/libavcodec/opusdec.c:141: undefined reference to `swr_convert'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_frame':
../ffmpeg/libavcodec/opusdec.c:201: undefined reference to `swr_convert'
/usr/local/lib/liba

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值