解决依赖库libunwind编译报错undefined reference to ‘lzma_stream_buffer_decode‘

文章讲述了在将程序MyApp从机器A编译到机器B时遇到的链接错误,原因在于B机器缺少liblzma库。作者分析了问题,发现libunwind在某些情况下会自动链接liblzma。通过设置编译选项禁用minidebuginfo功能,成功解决了这个问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题背景

程序MyApp依赖第三方库libunwind,在A机器上编译好静态库libunwind.a之后,在B机器上基于libunwind.a编译MyApp。由于B机器上的lib环境与A机器上可能有差异,因此产生了编译报错。

错误信息

在编译MyApp时,链接libunwind静态库阶段,发生错误:undefined reference to ‘lzma_xx’:

MyApp/third_party/installed/lib/libunwind.a(elf64.o): In function `xz_uncompressed_size':
MyApp/third_party/src/libunwind/libunwind/src/elfxx.c:194: undefined reference to `lzma_stream_footer_decode'
MyApp/third_party/src/libunwind/libunwind/src/elfxx.c:201: undefined reference to `lzma_index_buffer_decode'
MyApp/third_party/src/libunwind/libunwind/src/elfxx.c:205: undefined reference to `lzma_index_size'
MyApp/third_party/src/libunwind/libunwind/src/elfxx.c:210: undefined reference to `lzma_index_end'
MyApp/third_party/src/libunwind
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值