Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to use C++11 in a Visual Micro project (Read 3711 times)
Scotty
Newbies
*
Offline


Posts: 8
Joined: Oct 7th, 2015
How to use C++11 in a Visual Micro project
Dec 1st, 2015 at 9:28pm
Print Post  
Hi there,

See the following post on stack overflow where they show how to use C++11 with Arduino projects.
http://stackoverflow.com/questions/16224746/how-to-use-c11-to-program-the-arduin...

Quote:
On the latests versions of the Arduino IDE, in fact it is very easy to change the flags for any element of the toolchain, including the assembler, compiler, linker or archiver.

Tested on the Arduino IDE version 1.5.7 (released on July 2014),

Locate the platform.txt file,
AVR architecture => {install path}\hardware\arduino\avr\platform.txt
SAM architecture => {install path}\hardware\arduino\sam\platform.txt
Inside that file, you can change any flag, for instance,
compiler.c.flags for changing the default compilation flags for C++ files.
compiler.cpp.flags for changing the default compilation flags for C++ files.
You can also change any of the "recipes" or compile patters, at the corresponding section of the configuration file, under the title "AVR/SAM compile patterns".
After making the changes, you must restart the Arduino IDE, at least on version 1.5.7.
For instance,

To enable support for C++11 (C++0x), tested on Arduino IDE versions 1.5.7 and 1.5.8, you will simply add the flag "-std=gnu++11" at the end of the line starting with compiler.cpp.flags=".
It is expected that C++11 is enabled by default in the near future on the Arduino IDE. However, as of version 1.5.8 (Oct 2014) it is still not the case.



How can we do this with Visual Micro projects?

Regards,

Scott
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to use C++11 in a Visual Micro project
Reply #1 - Dec 1st, 2015 at 10:34pm
Print Post  
Hi,

The purpose of visual micro is to use the exact same config. So follow the guide and it will also work for Visual Micro.

Visual Micro also allows an easier way than that. View the "Project Properties>Micro General (Project Global)>Extra c flags" and "Extra cpp flags"

If you change the config files on disk as per the article restart the ide or click tools>visual micro>reload toolchains". Adding "-std=gnu++11" to the project properties should automatically cause a full rebuild when you next build otherwise click Build>Clean before building.


  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint