[SOLVED] C++ build errors: undefined symbol: __dso_handle

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] C++ build errors: undefined symbol: __dso_handle

    Hello,
    Today I tried create a new simulation project for learning new features C++20, but failed.
    This project: Sandbox.7z

    So, The project consists of a main file and a class file. The class file only describes the constructor and destructor.

    C Source Code

    1. // Task.cpp file:
    2. #include "task.hpp"
    3. Task::Task() {
    4. }
    5. Task::~Task(){
    6. }
    7. // Task.hpp file:
    8. #ifndef task_hpp
    9. #define task_hpp
    10. class Task{
    11. public:
    12. Task();
    13. ~Task();
    14. };
    15. #endif /*task_hpp*/
    Display All

    If Project option -> Library -> Runtime Library i choose: Embedded Studio the build is success.
    But if I choose SEGGER, the biuld is fail with errors:

    Source Code

    1. Building ‘sandbox’ from solution ‘sandbox’ in configuration ‘Debug’
    2. Compiling ‘system_nrf52.c’
    3. Linking sandbox.elf
    4. undefined symbol: __cxa_atexit
    5. undefined symbol: __dso_handle
    6. Build failed
    But if you comment out the destructor, then the project is built with any library.

    What could I "break" ^^ ?

    ________________________________________________
    best regards,
    Max
  • Hello Max,

    Which version of Embedded Studio are you using? Could you give the latest version a try?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Nino,

    It's miracle. There is an error on version 5.42 and below. Now I tried 5.42a and the error disappeared.

    Indeed, in the list of changes for 5.42a there is an item:
    Build
    • Add project property Enable Use Of __cxa_atexit.


    I missed the moment. I'm sorry for worrying too much
    ________________________________________________
    best regards,
    Max
  • Hello Max,

    no worries, good to hear that you are up and running again.
    We will consider this thread as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.