问题背景
程序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