I'm having problems compiling release fhDOOM (https://github.com/eXistence/fhDOOM) on Ubuntu 18.04 with g++ 7.4.
I have tried installing g++ 4.9 but the compiler doesn't use it.
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
It looks like you are missing symbols. Can you try rebuilding the Makefile(s) itself? Is there any configure script around by chance?
This is a project that was worked on a while ago. It used androind-ndk-r7b to compile and android-2.3.7 to test the code. I was given the task to port it to the latest android or atleast 4.4. The source code is one year old, so the last compiler it supports is gcc-4.6 and g++-4.6. Therefore, I used android-ndk-r10d, which is the last revision of android ndk to support the 4.6 compiler. Now I compile some external android libraries, which are compiled without any issue. Then, I compile the source code of my application using ndk. The ndk is supposed to generate a shared library that can be used in my app. The shared library links to the external android libraries which are already compiler. So when the ndk-build script gets to the last step of generating the shared library file, I get this weird error. I have looked alot on the internet and could not find anything related to it. Please, need expert advice.
The error is:
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: format 'default' not supported; treating as elf (supported formats: elf, binary)
If you need more info on the problem, let me know. I'll upload more info.
Update:
Sorry, I am a newbie to stack overflow. Thanks for keeping up with me. So I get these and many other errors. I think these are standard functions that shouldn't be undefined.
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(atexit_arm.o): in function __aeabi_atexit:/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/atexit_arm.cc:35: error: undefined reference to '__cxa_atexit'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_globals.o): in function __eh_globals_init::~__eh_globals_init():/tmp/ndk-user/tmp/gnu-libstdc++/static-armeabithumb-4.6/include/arm-linux-androideabi/bits/gthr-default.h:727: error: undefined reference to 'pthread_key_delete'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_globals.o): in function __cxa_get_globals_fast:/tmp/ndk-user/tmp/gnu-libstdc++/static-armeabithumb-4.6/include/arm-linux-androideabi/bits/gthr-default.h:733: error: undefined reference to 'pthread_getspecific'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_globals.o): in function __cxa_get_globals:/tmp/ndk-user/tmp/gnu-libstdc++/static-armeabithumb-4.6/include/arm-linux-androideabi/bits/gthr-default.h:733: error: undefined reference to 'pthread_getspecific'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_globals.o): in function __cxa_get_globals:/tmp/ndk-user/tmp/gnu-libstdc++/static-armeabithumb-4.6/include/arm-linux-androideabi/bits/gthr-default.h:739: error: undefined reference to 'pthread_setspecific'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_globals.o): in function _GLOBAL__sub_I_eh_globals.cc:/tmp/ndk-user/tmp/gnu-libstdc++/static-armeabithumb-4.6/include/arm-linux-androideabi/bits/gthr-default.h:721: error: undefined reference to 'pthread_key_create'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_personality.o): in function read_encoded_value_with_base(unsigned char, unsigned int, unsigned char const*, unsigned int*):/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/../gcc/unwind-pe.h:257: error: undefined reference to 'abort'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_personality.o): in function base_of_encoded_value(unsigned char, _Unwind_Context*):/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/../gcc/unwind-pe.h:120: error: undefined reference to 'abort'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_personality.o): in function __gxx_personality_v0:/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/eh_personality.cc:402: error: undefined reference to 'abort'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(eh_terminate.o): in function __cxxabiv1::__terminate(void ()()):/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/eh_terminate.cc:41: error: undefined reference to 'abort'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(guard.o): in function __cxa_guard_acquire:/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/guard.cc:273: error: undefined reference to 'syscall'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(guard.o): in function __cxa_guard_abort:/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/guard.cc:332: error: undefined reference to 'syscall'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(guard.o): in function __cxa_guard_release:/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/guard.cc:372: error: undefined reference to 'syscall'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(pure.o): in function __cxa_pure_virtual:/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/pure.cc:49: error: undefined reference to 'write'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(locale_init.o): in function std::locale::_S_initialize():/tmp/ndk-user/tmp/gnu-libstdc++/static-armeabithumb-4.6/include/arm-linux-androideabi/bits/gthr-default.h:713: error: undefined reference to 'pthread_once'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(locale_init.o): in function std::locale::global(std::locale const&):/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/src/locale_init.cc:246: error: undefined reference to 'setlocale'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(codecvt_members.o): in function std::codecvt::do_out(mbstate_t&, wchar_t const, wchar_t const*, wchar_t const*&, char*, char*, char*&) const:codecvt_members.cc:81: error: undefined reference to 'wcrtomb'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(codecvt_members.o): in function std::codecvt::do_out(mbstate_t&, wchar_t const*, wchar_t const*, wchar_t const*&, char*, char*, char*&) const:codecvt_members.cc:66: error: undefined reference to 'wcrtomb'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(codecvt_members.o): in function std::codecvt::do_in(mbstate_t&, char const*, char const*, char const*&, wchar_t*, wchar_t*, wchar_t*&) const:codecvt_members.cc:126: error: undefined reference to 'mbrtowc'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(codecvt_members.o): in function std::codecvt::do_length(mbstate_t&, char const*, char const*, unsigned int) const:codecvt_members.cc:191: error: undefined reference to 'mbrtowc'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(collate_members.o): in function std::collate::_M_compare(char const*, char const*) const:collate_members.cc:46: error: undefined reference to 'strcoll'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(collate_members.o): in function std::collate::_M_transform(char*, char const*, unsigned int) const:collate_members.cc:54: error: undefined reference to 'strxfrm'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(collate_members.o): in function std::collate::_M_compare(wchar_t const*, wchar_t const*) const:collate_members.cc:62: error: undefined reference to 'wcscoll'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(collate_members.o): in function std::collate::_M_transform(wchar_t*, wchar_t const*, unsigned int) const:collate_members.cc:70: error: undefined reference to 'wcsxfrm'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::_M_convert_to_wmask(char) const:ctype_members.cc:91: error: undefined reference to 'wctype'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::_M_convert_to_wmask(char) const:ctype_members.cc:94: error: undefined reference to 'wctype'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::_M_convert_to_wmask(char) const:ctype_members.cc:76: error: undefined reference to 'wctype'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::_M_convert_to_wmask(char) const:ctype_members.cc:67: error: undefined reference to 'wctype'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_toupper(wchar_t) const:ctype_members.cc:104: error: undefined reference to 'towupper'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_toupper(wchar_t*, wchar_t const*) const:ctype_members.cc:111: error: undefined reference to 'towupper'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_tolower(wchar_t) const:ctype_members.cc:119: error: undefined reference to 'towlower'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_tolower(wchar_t*, wchar_t const*) const:ctype_members.cc:126: error: undefined reference to 'towlower'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_is(char, wchar_t) const:ctype_members.cc:142: error: undefined reference to 'iswctype'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_is(wchar_t const*, wchar_t const*, char*) const:ctype_members.cc:161: error: undefined reference to 'iswctype'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_narrow(wchar_t, char) const:ctype_members.cc:210: error: undefined reference to 'wctob'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_narrow(wchar_t const*, wchar_t const*, char, char*) const:ctype_members.cc:235: error: undefined reference to 'wctob'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::do_narrow(wchar_t const*, wchar_t const*, char, char*) const:ctype_members.cc:226: error: undefined reference to 'wctob'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::_M_initialize_ctype():ctype_members.cc:249: error: undefined reference to 'wctob'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(ctype_members.o): in function std::ctype::_M_initialize_ctype():ctype_members.cc:261: error: undefined reference to 'btowc'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(time_members.o): in function std::__timepunct::_M_put(char*, unsigned int, char const*, tm const*) const:time_members.cc:56: error: undefined reference to 'strftime'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(time_members.o): in function std::__timepunct::_M_put(wchar_t*, unsigned int, wchar_t const*, tm const*) const:time_members.cc:145: error: undefined reference to 'wcsftime'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(time_members.o): in function std::__timepunct::_M_put(wchar_t*, unsigned int, wchar_t const*, tm const*) const:time_members.cc:145: error: undefined reference to 'wcsftime'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(vterminate.o): in function __gnu_cxx::__verbose_terminate_handler():/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/vterminate.cc:71: error: undefined reference to 'fputs'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/thumb/libgnustl_static.a(vterminate.o): in function __gnu_cxx::__verbose_terminate_handler():/s/ndk-toolchain/src/gcc/gcc-4.6/libstdc++-v3/libsupc++/vterminate.cc:87: error: undefined reference to 'fputc'
/home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/zeeshan/Downloads/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/thumb/libgcc.a(_dvmd_lnx.o): in function __aeabi_idiv0:/s/ndk-toolchain/src/build/../gcc/gcc-4.6/libgcc/../gcc/config/arm/lib1funcs.asm:1270: error: undefined reference to 'raise'
I'm trying to create a haar classifier following this tutorial: http://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html
I'm at the part where you compile opencv C++ files, with mergevec.cpp, about 1/4th of the way down. I entered
g++ -L C:\opencv\build\x64\vc11\lib -IC:\opencv\build\include\opencv -IC:\opencv\build\include\opencv -IC:\opencv\build\include\opencv2 -I.-o mergevec mergevec.cpp\
cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp\
cvhaartraining.cpp\
-lopencv_core2411 -lopencv_calib3d2411 -lopencv_imgproc2411 -lopencv_highgui2411 -lopencv_objdetect2411
(Pkg-config created a lot of problems for me, so I specified the include and lib directories directly in the command). I got the following output:
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x3f67): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x3f80): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x3f8f): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4106): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x411f): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x412e): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x42d2): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x42eb): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x42fa): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x447a): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4493): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x44a2): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4634): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x464d): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x465c): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x47e1): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x47fa): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4809): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x49ee): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4a07): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4a16): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4b9b): undefined reference to `cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4bb4): undefined reference to `cv::error(cv::Exception const&)'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x4bc3): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x5168): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x52bc): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x53db): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x54fa): undefined reference to `cv::Exception::~Exception()'
C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o:cvboost.cpp:(.text+0x5619): more undefined references to `cv::Exception::~Exception()' follow
...
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\nancy\AppData\Local\Temp\cco1Zm1B.o: bad reloc address 0x0 in section `.data'
collect2: ld returned 1 exit status
I'm not sure what is causing this error. I'm using the command prompt on a windows 7 machine, and I run it from the directory C:\opencv\sources\apps\haartraining
A copy of my cvboost.cpp, which is in opencv/sources/apps/haartraining can be found at https://github.com/matitone/OpenCV_Example. I believe this is the file causing the error.
Please let me know if more information would be helpful Thank you.
I have not mine C++ project, which I can successfully compile using this line:
g++ -o minit minit.c MinitGlobal.h Item.c ItemsetQueue.c Transaction.c Error.h Dataset.c SubDataset.c RankItems.c MinitAlgo.c but if I add optimization level like below (same for -O3):
[ec2-user#ip-10-209-16-177 minit++]$ g++ -o -O0 minit minit.c MinitGlobal.h Item.c ItemsetQueue.c Transaction.c Error.h Dataset.c SubDataset.c RankItems.c MinitAlgo.c
minit: In function `_start':
(.text+0x2a8): multiple definition of `_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.text+0x0): first defined here
minit: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.fini+0x0): first defined here
minit:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.rodata.cst4+0x0): first defined here
minit: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.data+0x0): first defined here
minit:(.rodata+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtbegin.o:(.rodata+0x0): first defined here
minit: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.init+0x0): first defined here
/tmp/cc0cvoT6.o: In function `main':
minit.c:(.text+0x4d2): multiple definition of `main'
minit:(.text+0x0): first defined here
/tmp/ccRfRvQv.o:(.bss+0x0): multiple definition of `minit::Itemset::count'
minit:(.bss+0x638): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0x7e): multiple definition of `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)'
minit:(.text+0x430): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0xfe): multiple definition of `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)'
minit:(.text+0x520): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::dequeue()':
ItemsetQueue.c:(.text+0x186): multiple definition of `minit::ItemsetQueue::dequeue()'
minit:(.text+0x3b0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x1f2): multiple definition of `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0x6d0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x306): multiple definition of `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0xa60): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x0): multiple definition of `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x16b0): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x14a): multiple definition of `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x15b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)':
Dataset.c:(.text+0x644): multiple definition of `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x2350): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::toString() const':
Dataset.c:(.text+0x7f0): multiple definition of `minit::Dataset::toString() const'
minit:(.text+0x1c00): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::printColumnInfo()':
Dataset.c:(.text+0x9d6): multiple definition of `minit::Dataset::printColumnInfo()'
minit:(.text+0x2200): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/cc3PBOXh.o:(.bss+0x0): multiple definition of `minit::SubDataset::count'
minit:(.bss+0x670): first defined here
/tmp/cc3PBOXh.o:(.bss+0x10): multiple definition of `minit::SubDataset::preComputeCallsPerMaxc'
minit:(.bss+0x650): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::supportSet(unsigned int) const':
SubDataset.c:(.text+0x242): multiple definition of `minit::SubDataset::supportSet(unsigned int) const'
minit:(.text+0x33a0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)':
SubDataset.c:(.text+0x2ac): multiple definition of `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)'
minit:(.text+0x40d0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)':
SubDataset.c:(.text+0x514): multiple definition of `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)'
minit:(.text+0x3f30): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::doneWithAnchorItem(unsigned int const&)':
SubDataset.c:(.text+0x6a0): multiple definition of `minit::SubDataset::doneWithAnchorItem(unsigned int const&)'
minit:(.text+0x37e0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o:(.bss+0x0): multiple definition of `minit::RankItems::count'
minit:(.bss+0x680): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::toString() const':
RankItems.c:(.text+0x4e0): multiple definition of `minit::RankItems::toString() const'
minit:(.text+0x5130): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::search(int, int, bool)':
MinitAlgo.c:(.text+0x1ee): multiple definition of `minit::MinitAlgo::search(int, int, bool)'
minit:(.text+0x93f0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)':
MinitAlgo.c:(.text+0x6fc): multiple definition of `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)'
minit:(.text+0x9860): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)':
MinitAlgo.c:(.text+0x678): multiple definition of `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)'
minit:(.text+0x6d70): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)':
MinitAlgo.c:(.text+0x10f0): multiple definition of `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)'
minit:(.text+0x6fe0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
minit:(.dtors+0x8): first defined here
/usr/bin/ld: error in minit(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld returned 1 exit status
[ec2-user#ip-10-209-16-177 minit++]$
[ec2-user#ip-10-209-16-177 minit++]$ g++ -o -O0 minit minit.c MinitGlobal.h Item.c ItemsetQueue.c Transaction.c Error.h Dataset.c SubDataset.c RankItems.c MinitAlgo.c
minit: In function `_start':
(.text+0x2a8): multiple definition of `_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.text+0x0): first defined here
minit: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.fini+0x0): first defined here
minit:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.rodata.cst4+0x0): first defined here
minit: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.data+0x0): first defined here
minit:(.rodata+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtbegin.o:(.rodata+0x0): first defined here
minit: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.init+0x0): first defined here
/tmp/cc0cvoT6.o: In function `main':
minit.c:(.text+0x4d2): multiple definition of `main'
minit:(.text+0x0): first defined here
/tmp/ccRfRvQv.o:(.bss+0x0): multiple definition of `minit::Itemset::count'
minit:(.bss+0x638): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0x7e): multiple definition of `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)'
minit:(.text+0x430): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0xfe): multiple definition of `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)'
minit:(.text+0x520): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::dequeue()':
ItemsetQueue.c:(.text+0x186): multiple definition of `minit::ItemsetQueue::dequeue()'
minit:(.text+0x3b0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x1f2): multiple definition of `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0x6d0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x306): multiple definition of `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0xa60): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x0): multiple definition of `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x16b0): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x14a): multiple definition of `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x15b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)':
Dataset.c:(.text+0x644): multiple definition of `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x2350): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::toString() const':
Dataset.c:(.text+0x7f0): multiple definition of `minit::Dataset::toString() const'
minit:(.text+0x1c00): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::printColumnInfo()':
Dataset.c:(.text+0x9d6): multiple definition of `minit::Dataset::printColumnInfo()'
minit:(.text+0x2200): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/cc3PBOXh.o:(.bss+0x0): multiple definition of `minit::SubDataset::count'
minit:(.bss+0x670): first defined here
/tmp/cc3PBOXh.o:(.bss+0x10): multiple definition of `minit::SubDataset::preComputeCallsPerMaxc'
minit:(.bss+0x650): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::supportSet(unsigned int) const':
SubDataset.c:(.text+0x242): multiple definition of `minit::SubDataset::supportSet(unsigned int) const'
minit:(.text+0x33a0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)':
SubDataset.c:(.text+0x2ac): multiple definition of `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)'
minit:(.text+0x40d0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)':
SubDataset.c:(.text+0x514): multiple definition of `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)'
minit:(.text+0x3f30): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::doneWithAnchorItem(unsigned int const&)':
SubDataset.c:(.text+0x6a0): multiple definition of `minit::SubDataset::doneWithAnchorItem(unsigned int const&)'
minit:(.text+0x37e0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o:(.bss+0x0): multiple definition of `minit::RankItems::count'
minit:(.bss+0x680): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::toString() const':
RankItems.c:(.text+0x4e0): multiple definition of `minit::RankItems::toString() const'
minit:(.text+0x5130): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::search(int, int, bool)':
MinitAlgo.c:(.text+0x1ee): multiple definition of `minit::MinitAlgo::search(int, int, bool)'
minit:(.text+0x93f0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)':
MinitAlgo.c:(.text+0x6fc): multiple definition of `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)'
minit:(.text+0x9860): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)':
MinitAlgo.c:(.text+0x678): multiple definition of `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)'
minit:(.text+0x6d70): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)':
MinitAlgo.c:(.text+0x10f0): multiple definition of `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)'
minit:(.text+0x6fe0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
minit:(.dtors+0x8): first defined here
/usr/bin/ld: error in minit(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld returned 1 exit status
[ec2-user#ip-10-209-16-177 minit++]$
It crashes. All the errors are of "multiple definition" nature, could you please suggest how to fix that?
gcc/g++ expect the name of the output file directly after -o. You mixed up the argument order:
Instead of g++ -o -O0 minit ... try g++ -O0 -o minit ....
g++ tried to link the executable minit and the objects files together into one assembly, that's why you get these errors.