对__cxa_throw_bad_array_new_length的未定义引用 (G++ 7.4)

undefined reference to __cxa_throw_bad_array_new_length (g++ 7.4)

本文关键字:引用 G++ 未定义 length throw cxa bad array new      更新时间:2023-10-16

我在使用 g++ 7.4 在 Ubuntu 18.04 上编译发布 fhDOOM (https://github.com/eXistence/fhDOOM( 时遇到问题。

我尝试过安装 g++ 4.9,但编译器不使用它。

CMakeFiles/fhDOOM.dir/renderer/draw_glsl.cpp.o: In function 
'RB_GLSL_DrawInteractions()': draw_glsl.cpp:(.text+0x2867): 
undefined reference to '__cxa_throw_bad_array_new_length'
CMakeFiles/fhDOOM.dir/cm/CollisionModel_load.cpp.o: In function 'idCollisionModelManagerLocal::ConvertPatch(cm_model_s*, idMapPatch const*, int)': CollisionModel_load.cpp:(.text+0xa2d0): 
undefined reference to '__cxa_throw_bad_array_new_length' CollisionModel_load.cpp:(.text+0xa2d8): 
undefined reference to '__cxa_throw_bad_array_new_length' CollisionModel_load.cpp:(.text+0xa2e0): 
undefined reference to '__cxa_throw_bad_array_new_length' CollisionModel_load.cpp:(.text+0xa2e8): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/framework/async/ServerScan.cpp.o:ServerScan.cpp:(.text+0x1b20): more undefined references to '__cxa_throw_bad_array_new_length' follow 
CMakeFiles/fhDOOM.dir/renderer/Model.cpp.o: In function 'idRenderModelStatic::ConvertOBJToModelSurfaces(objModel_t const*)': Model.cpp:(.text+0x921f): 
undefined reference to 'std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned int) const' Model.cpp:(.text+0xb305): 
undefined reference to '__cxa_throw_bad_array_new_length' Model.cpp:(.text+0xb36f): 
undefined reference to '__cxa_throw_bad_array_new_length' Model.cpp:(.text+0xb37a): 
undefined reference to '__cxa_throw_bad_array_new_length' Model.cpp:(.text+0xb3f3): 
undefined reference to '__cxa_throw_bad_array_new_length' Model.cpp:(.text+0xb3fe): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/renderer/Model.cpp.o:Model.cpp:(.text+0xb409): more undefined references to '__cxa_throw_bad_array_new_length' follow 
CMakeFiles/fhDOOM.dir/renderer/Model.cpp.o: In function 'std::_Hashtable<objVertex_t, std::pair<objVertex_t const, int>, std::allocator<std::pair<objVertex_t const, int> >, std::__detail::_Select1st, std::equal_to<objVertex_t>, std::hash<objVertex_t>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned int, unsigned int, std::__detail::_Hash_node<std::pair<objVertex_t const, int>, true>*)': Model.cpp:(.text._ZNSt10_HashtableI11objVertex_tSt4pairIKS0_iESaIS3_ENSt8__detail10_Select1stESt8equal_toIS0_ESt4hashIS0_ENS5_18_Mod_range_hashingENS5_20_Default_ranged_hashENS5_20_Prime_rehash_policyENS5_17_Hashtable_traitsILb1ELb0ELb1EEEE21_M_insert_unique_nodeEjjPNS5_10_Hash_nodeIS3_Lb1EEE[_ZNSt10_HashtableI11objVertex_tSt4pairIKS0_iESaIS3_ENSt8__detail10_Select1stESt8equal_toIS0_ESt4hashIS0_ENS5_18_Mod_range_hashingENS5_20_Default_ranged_hashENS5_20_Prime_rehash_policyENS5_17_Hashtable_traitsILb1ELb0ELb1EEEE21_M_insert_unique_nodeEjjPNS5_10_Hash_nodeIS3_Lb1EEE]+0x4b): 
undefined reference to 'std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned int, unsigned int, unsigned int) const' 
CMakeFiles/fhDOOM.dir/renderer/ModelManager.cpp.o: In function 'idRenderModelManagerLocal::PrintMemInfo(MemInfo_t*)': ModelManager.cpp:(.text+0xe16): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/renderer/ModelManager.cpp.o: In function 'idRenderModelManagerLocal::AddModel(idRenderModel*)': ModelManager.cpp:(.text+0x15ba): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/renderer/RenderSystem.cpp.o: In function 'idRenderSystemLocal::AllocRenderWorld()': RenderSystem.cpp:(.text+0x2a61): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/renderer/RenderSystem_init.cpp.o: In function '.L58': RenderSystem_init.cpp:(.text+0x494): 
undefined reference to 'std::__throw_system_error(int)' 
CMakeFiles/fhDOOM.dir/renderer/RenderSystem_init.cpp.o: In function '.L573': RenderSystem_init.cpp:(.text+0x32de): 
undefined reference to 'std::__throw_system_error(int)' 
CMakeFiles/fhDOOM.dir/renderer/RenderSystem_init.cpp.o: In function 'RB_PrintDebugOutput()': RenderSystem_init.cpp:(.text+0x398d): 
undefined reference to 'std::__throw_system_error(int)' 
CMakeFiles/fhDOOM.dir/renderer/RenderSystem_init.cpp.o: In function '.L806': RenderSystem_init.cpp:(.text+0x4e16): 
undefined reference to 'std::__throw_system_error(int)' 
CMakeFiles/fhDOOM.dir/renderer/ShadowMapAllocator.cpp.o: In function 'fhShadowMapAllocator::fhShadowMapAllocator()': ShadowMapAllocator.cpp:(.text+0x4d6): 
undefined reference to '__cxa_throw_bad_array_new_length' ShadowMapAllocator.cpp:(.text+0x503): 
undefined reference to '__cxa_throw_bad_array_new_length' ShadowMapAllocator.cpp:(.text+0x50b): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/renderer/ShadowMapAllocator.cpp.o: In function 'fhShadowMapAllocator::FreeAll()': ShadowMapAllocator.cpp:(.text+0x79c): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/renderer/ShadowMapAllocator.cpp.o: In function 'fhShadowMapAllocator::Make(int)': ShadowMapAllocator.cpp:(.text+0xb28): 
undefined reference to '__cxa_throw_bad_array_new_length' 
CMakeFiles/fhDOOM.dir/renderer/ShadowMapAllocator.cpp.o:ShadowMapAllocator.cpp:(.text+0xf89): more undefined references to '__cxa_throw_bad_array_new_length' follow
collect2: error: ld returned 1 exit status
neo/CMakeFiles/fhDOOM.dir/build.make:4676: recipe for target 'bin/fhDOOM' failed
make[2]: *** [bin/fhDOOM] Error 1 
CMakeFiles/Makefile2:261: recipe for target 'neo/CMakeFiles/fhDOOM.dir/all' failed
make[1]: *** [neo/CMakeFiles/fhDOOM.dir/all] Error 2
Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

看起来你缺少符号。您可以尝试重建生成文件本身吗?有没有偶然的配置脚本?