I am building a program which implement kD-Tree and kNN by C++, the dataset using mnist. When I compiled the program using command:
g++ -o main main.cpp kDTree.cpp Dataset.o -I . -std=c++11
g++ version 10.3
The error showed that
C:/StPerl532_x64/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Dataset.o:Dataset.cpp:(.text$_ZNSt15__new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8allocateEyPKv[_ZNSt15__new_allocatorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE8allocateEyPKv]+0x4a): undefined reference to
std::__throw_bad_array_new_length()' C:/StPerl532_x64/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Dataset.o:Dataset.cpp:(.text$_ZNSt15__new_allocatorISt10_List_nodeIiEE8allocateEyPKv[_ZNSt15__new_allocatorISt10_List_nodeIiEE8allocateEyPKv]+0x4a): undefined reference to
std::__throw_bad_array_new_length()’
C:/StPerl532_x64/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: Dataset.o:Dataset.cpp:(.text$_ZNSt15__new_allocatorISt10_List_nodeINSt7__cxx114listIiSaIiEEEEE8allocateEyPKv[_ZNSt15__new_allocatorISt10_List_nodeINSt7__cxx114listIiSaIiEEEEE8allocateEyPKv]+0x4a): undefined reference to `std::__throw_bad_array_new_length()’
collect2.exe: error: ld returned 1 exit status
any one can help? Should I need to upgrade g++ to higher version? Thank you.