xavr icon indicating copy to clipboard operation
xavr copied to clipboard

C++ support

Open maziarzamani opened this issue 11 years ago • 2 comments

Is it possible to extend this magnificent template to support C++?

maziarzamani avatar Dec 25 '14 19:12 maziarzamani

Thanks for the kind words @maziarzamani :)

C++ is not particularly my forte: I've never done C++ for AVR and micro-controllers in general.

If you feel like it, I would definitely appreciate any pull request for this.

jawher avatar Dec 26 '14 20:12 jawher

I realised that compiling C-files with GCC and CPP-files with G++ requires name mangling, by setting function declarations with the extern parameter. Basically i just changed the compiler for both file types to G++ instead and it seems to do the trick.

Also described here: http://stackoverflow.com/a/18879053/531203

maziarzamani avatar Dec 28 '14 13:12 maziarzamani