Search code examples
c++qt-creatorsymbianlinker-errors

Error: "undefined reference to `__cxa_get_exception_ptr'" when compiling Qt Creator project for Symbian


When I compile the project for Windows, it builds and runs fine, but when I try to compile it for Symbian S60, I get this error:

undefined reference to `__cxa_get_exception_ptr'

Solution

  • Found the answer here:

    Catch by reference rather than by value

    Catching by value causes GCC to use the compiler support function __cxa_get_exception_ptr. This is not available in the compiler support libraries on Symbian OS prior to Symbian^3. Catching by reference avoids this problem.

    So replacing

    catch (QString error)
    

    with

    catch (QString &error)
    

    fixes it.