jawher / xavr

An AVR C project template for XCode
MIT License
68 stars 18 forks source link

C++ support #5

Open maziarzamani opened 9 years ago

maziarzamani commented 9 years ago

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

jawher commented 9 years ago

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.

maziarzamani commented 9 years ago

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