对__cxa_throw_bad_array_new_length的未定义引用 (G++ 7.4)
undefined reference to __cxa_throw_bad_array_new_length (g++ 7.4)
我在使用 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
看起来你缺少符号。您可以尝试重建生成文件本身吗?有没有偶然的配置脚本?
相关文章:
- 将对象数组的引用传递给函数
- 什么时候在C++中返回常量引用是个好主意
- 我想将一个对T类型的非常量左值引用绑定到一个T类型的临时值
- 何时在引用或唯一指针上使用移动语义
- 如何在c++中使用引用实现类似python的行为
- 编译C++时未定义的引用
- Ctypes wstring通过引用传递
- c++r值引用应用于函数指针
- 理解c++中的引用
- C++取消引用指针.为什么会发生变化
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- C++Boost Asio Pool线程,带有lambda函数和传递引用变量
- 强制转换为引用类型
- 引用一个已擦除类型(void*)的指针
- 向量元素的引用地址与它所指向的向量元素的地址不同.为什么
- 具有默认值的引用获取函数
- 如何使用基类指针引用派生类成员
- 使用取消引用的指针的多态性会产生意外的结果.为什么?
- 如何引用基类的派生类?