I have been migrating an IAR project to Atmel Studio 6. It took me some time to create all the folders and getting the right structure as it is in the IAR project. Then I realized that I created a C project when actually I have C++ code too. So the question is: How do I change the GCC compiler from C to C++ without having to create a new project?
I can not find any proper documentation about Atmel Studio 6. I addition, I don't see a way to change this parameter from the GUI.
I found out that I don't have to change the C for the C++ compiler. I have to use both. Each compiler does its job. avr32-gcc compiles C code and avr32-gcccpp compiles C++ code. Now the question is: How do I add a second compiler to the project?
I already have the avr32-gcc for C.
For those interested in the solution here is how to do it:
Open you project in Atmel Studio 6 Go to the solution explorer and right click on the project. Select "Unload project" Now the project should be colored in gray. Right click again on the project and select Edit.
You will see the xml code from the configuration and settings of the project.
Around line 50 more o less you will find these lines:
<Language>C</Language>
<ToolchainName>com.Atmel.AVRGCC32.C</ToolchainName>
And modify them as follow, changing the language:
<Language>CPP</Language>
<ToolchainName>com.Atmel.AVRGCC32.CPP</ToolchainName>
Right click on the project again and select reload project.
Now if you go to the properties of the project (CTRL + F7) you will see two compilers in the Toolchain. Now you can compile both C and C++ code.