program linking fails when using custom built gcc

前端 未结 2 1071
醉话见心
醉话见心 2020-12-11 16:44

I\'m running a fedora 21 distribution, in which the default gcc is 4.9. I have a custom built gcc/g++ 4.8 in /usr/local/gcc48 (for instance, cuda requires gcc =< 4.8, and

2条回答
  •  一向
    一向 (楼主)
    2020-12-11 17:18

    It would be helpful if you post the error message in English.

    It appears that the undefined symbol is __cxa_throw_bad_array_new_length. The functions __cxa... come from the C++ runtime library. G++ usually ships with it's own version of this library, called libsupc++. I would guess that the custom-built G++ can not find this library or is emitting a reference to a symbol which is not in the newer (4.9) libsupc++. Try compiling the libsupc++ source that ships with your custom version of G++ and directing the linker toward it. You may also need to do this for libstdc++.

提交回复
热议问题