This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using C++ standard libraries

I am using C++ to program the nRF52 DK and I am trying to use the standard vector library.

When I try and compile it I get the linker error: ${GCC_PATH}/arm-none-eabi/include/c++/6.3.1/ext/new_allocator.h:104: undefined reference to `operator new(unsigned int)'

I have been trying to alter the makefile for a couple of hours and haven't had any success in getting the linker to recognise the missing libraries. Is it possible to include the c++ standard libraries?

Parents
  • That got rid of those errors but replaces it with an undefined reference to '__cxa_begin_catch' and some other similar ones. Here is the terminal output:

    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:427: undefined reference to `__cxa_begin_catch'
    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:434: undefined reference to `__cxa_rethrow'
    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:427: undefined reference to `__cxa_end_catch'
    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:427: undefined reference to `__cxa_end_cleanup'
    
Reply
  • That got rid of those errors but replaces it with an undefined reference to '__cxa_begin_catch' and some other similar ones. Here is the terminal output:

    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:427: undefined reference to `__cxa_begin_catch'
    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:434: undefined reference to `__cxa_rethrow'
    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:427: undefined reference to `__cxa_end_catch'
    /Users/michaelmcadam/SDK/Nordic_nf52/gcc-arm-none-eabi-6.3.1/arm-none-eabi/include/c++/6.3.1/bits/vector.tcc:427: undefined reference to `__cxa_end_cleanup'
    
Children
No Data
Related