AVR Studio 5 C++ Support

Great news for the AVR Studio users, the powerful IDE now supports C++ . Even in Beta , it is already easy to use and I managed to get my first ATMega8 LCD Class up and running.

By default, after a fresh AVR Studio 5 install, the C++ support is not enabled. Trying to create simple class like:

class lcd {
  public:
     void init();
}

Results in error:

“expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before

Renaming the .C project files to .CPP doesn’t help either and there seems to be no way to change the compiler go avr-g++.exe . Luckily, AVR Studio 5 supports C++, but an add-on must be installed. Here’s what you need to do:
step 1: Go to Tools->Extension Manager->Updates:

step 2: Select AVRGCC C++ (Beta) and click Download. Choose Install.

step 3: Finally, re-create your project, as a C++ project:

The compilation works, and the avr-g++.exe compiler is used automatically:

This article has 2 Comments

Leave a Reply