Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling (undefined reference to `__cxa_throw_bad_array_new_length') #23

Open
10010101001 opened this issue Sep 30, 2019 · 1 comment

Comments

@10010101001
Copy link

10010101001 commented Sep 30, 2019

Compiling release build on ubuntu 18.04 with g++ 7.4.
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

@eXistence
Copy link
Owner

i can't reproduce the issue. My notebook is basically the same system (Ubuntu 18.04 with gcc 7.4) and i have no problems.

I just tried the following in a virtual machine:

  • installed minimal version of Ubuntu 18.04 (Desktop, 64bit)
  • installed git
  • cloned repo from github
  • run setup_ubuntu.sh to install dependencies
  • run cmake_linux.sh gcc release to generate build files
  • cd build/gcc/release
  • make
    and everything compiled and linked just fine...

To me it seems like something is wrong with your gcc or standard library installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants