Ubuntu18.04编译老版本GCC遇到的问题:__cxa_throw_bad_array_new_length version CXXABI_1.3.8 not defined

由于工作关系,需要编译老版本的GCC(4.8)。但在Ubuntu18.04上遇到很多问题,其中最难解决的是如下问题:

/usr/lib/x86_64-linux-gnu/libicuuc.so.60: symbol __cxa_throw_bad_array_new_length version CXXABI_1.3.8 not defined in file libstdc++.so.6 with link time reference

经过一番摸索,终于找到问题的根源,并顺利解决。具体原因及方法如下:

1. 原因

编译libstdc++-v3时,会使用命令msgfmt。而msgfmt依赖libstdc++.so.6,但编译时,gcc的编译系统会把msgfmt的依赖指向其自身的libstdc++.so.6,而不是系统自带的libstdc++.so.6。

此时的libstdc++.so.6比较旧,导致与msgfmt版本不兼容,从而出现了上述错误。

2. 解决方法

网上有三种解决方法,

There are typically three plausible solutions:

1. Recompile the offending library with an older compiler.

2. Install a newever version of the C++ library.

3. Rebuild the C++ library from sources (with a new enough compiler).

但是都不太可行,因为我需要编译多个

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值