0

I am trying to build the OpenNN library with MinGW on Windows 10. I'm getting lots of build errors, which make me think I haven't configured something correctly using CMake.

I used the CMake GUI to configure, selecting "MinGW Makefiles" and "use default native compilers". It seems to configure and generate without errors.

However, when I try to build it from the command line, using "mingw32-make all", it compiles for about 5 minutes, then produces thousands of "undefined reference to `std::*" errors. These are some of them:

undefined reference to `__cxa_allocate_exception'
undefined reference to `std::logic_error::logic_error(std::string const&)'
undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
undefined reference to `std::logic_error::~logic_error()'
undefined reference to `__cxa_throw'
undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
undefined reference to `__cxa_allocate_exception'
undefined reference to `std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::str() const'
undefined reference to `__cxa_allocate_exception'
undefined reference to `std::allocator<char>::allocator()'
undefined reference to `__gxx_personality_sj0'
undefined reference to `operator delete(void*)'

What am I doing wrong? It mentions in the build instructions that it's compatible with "MPI and OpenMP compilations" (I assume it means compilers). Does that mean it's not compatible with MinGW? Because it mentions GNU in the list of OpenMP compatible compilers.

Rocketmagnet
  • 5,656
  • 8
  • 36
  • 47
  • Hmm, basic c++ functions... Looks like your MinGW environment is not configured properly. Have you able to build any C++ code in your environment? E.g. you may try "hello world" CMake example from http://derekmolloy.ie/hello-world-introductions-to-cmake. You don't specify neither `__OPENNN_MPI__` nor `__OPENNN_OMP__` for build OpenNN, am I right? – Tsyvarev Nov 23 '17 at 11:24
  • @Tsyvarev - Yup, I've had lots of projects build fine using code::blocks, which is using the MinGW environment. I don't specift __OPENNN_MPI__ because I'm not sure how to using the CMake GUI. I think this might be the problem. – Rocketmagnet Nov 23 '17 at 16:01
  • Without OpenMPI/OpenOMP, the only project's setup is `set (CMAKE_CXX_STANDARD 11)` (for g++ this means `-std=c++11` option). Then it simply builds executables and libraries. If MinGW works correctly for you, it could be a problem with CMake settings. Again, you may check that with "hello world" CMake example. – Tsyvarev Nov 23 '17 at 17:59

0 Answers0