Constructor causing undefined reference to `___gxx_personality_sj0'
DavidZemon
Posts: 2,973
I'm using the new operator as defined in SRLM's libpropeller. I have a constructor like so:
And linking fails with
If I change the initialization of m_var to something else, like an integer literal, all is good. I can get around this issue in a similar fashion to the pure virtual function code bloat, by defining an empty function for __gxx_personality_sj0(). Does anyone know if this will cause serious issues at runtime? I'm guessing it has to do with exception handlers of some sort???
MyClass (const MyOtherClass *driver) : m_driver(driver), m_var(driver->get_var()) {}
And linking fails with
undefined reference to `___gxx_personality_sj0'
If I change the initialization of m_var to something else, like an integer literal, all is good. I can get around this issue in a similar fashion to the pure virtual function code bloat, by defining an empty function for __gxx_personality_sj0(). Does anyone know if this will cause serious issues at runtime? I'm guessing it has to do with exception handlers of some sort???
Comments
a) Compiling with g++ instead of c++. (propeller-elf-g++ or whatever it is called)
or
b) Adding the option -lstdc++ to the end of the linker invocation line.
Did you actually try that? Did the code then compile? Did it run?
Does this code compile and run on other machines, Linux perhaps?
I guess we might need to see the whole code to get an idea. I don't see a function being defined in any way only the beginnings of a class definition.
That seems to be in a test directory, i.e. not for general use.
Why not just us the normal "new"?
Why don't any of the documentation links in the readme/front page work at https://github.com/DavidZemon/PropWare ?
I had a choice between functional links on the Doxygen page or functional links on github - both wasn't an option
So, the links on http://david.zemon.name/PropWare should all work correctly.
Sorry - I thought I committed this code days ago but apparently not. The constructor in question can be found in the release-2.0-nightly branch in fatfs.h