Go Down

Topic: __cxa_pure_virtual (Read 1 time) previous topic - next topic

GorillaCoderAtWork

Prior to version 11 I wrote a couple of small frameworks using pure virtuals. In order for this to work I had to define:
   extern "C" void __cxa_pure_virtual();
Just upgraded to version 11, and found that __cxa_pure_virtual is now declared for me. Trouble is, it is declared WRONG, without the extern "C". The compiler complains because the declarations don't match. If I remove the 'extern "C"', then the reference is not found by the linker and that dies.

I've worked around it by defining the library CppStubs and moving my definition of __cxa_pure_virtual (and delete) into there. Probably a better place for it anyhow.

But you might want to fix the declaration of __cxa_pure_virtual.

mellis

I didn't even know you could use virtual functions with avr-g++.  Does it actually work?

There's certainly no explicit definition of __cxa_pure_virtual in the Arduino source code.  Do you know where it's defined?  

Do you have a small, complete example of a sketch or program that use virtual functions?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy