scarphin: have you tried it? Your solution looks brutal.
Well, no!
I haven't because of 2 reasons, 1st I have no experience in C++ and 2nd it is utopia to program the AVR's in C++ without the stdlib++ support (regarding AVRGCC) in my opinion. I proposed this solution because I am not sure if the 'avr-gcc' launches the C++ compiler for '.cpp' extension (as it launches the assembler for the '.S' extension) or if CodeBlocks launches the C++ compiler for '.cpp' extension.
It might be brutal but I guess it's guaranteed to work out.
I also would like to know if there is a better way apart from those or if the C++ compiler gets launched in any of the cases above.