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 do I change the compiler version to C++ 17 (it's now 11) ? (Read 2431 times)
Bruce S
Junior Member
**
Offline


Posts: 11
Location: Ohio, USA
Joined: Nov 11th, 2014
How do I change the compiler version to C++ 17 (it's now 11) ?
May 3rd, 2023 at 3:34am
Print Post  
How do I change the compiler version to C++ 17 (it's now 11) ? I have Visual Micro with MSVC 2019.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2710
Joined: Feb 13th, 2019
Re: How do I change the compiler version to C++ 17 (it's now 11) ?
Reply #1 - May 3rd, 2023 at 7:35am
Print Post  
Please provide the logging information with the settings shown at the top of the page.

The compiler is normally determined and supplied as part of your board package, which Visual Micro then uses for compilation and in the latest versions it uses the same version for intellisense. If your project is in the latest format it will have "(Arduino)" shown after the project name in the Solution Explorer window.
  
Back to top
IP Logged
 
Bruce S
Junior Member
**
Offline


Posts: 11
Location: Ohio, USA
Joined: Nov 11th, 2014
Re: How do I change the compiler version to C++ 17 (it's now 11) ?
Reply #2 - May 4th, 2023 at 6:23pm
Print Post  
Hi, thanks for the reply.  Here is a build output of a new project that I just added blinking led to.  I didn't include it before since I'm not attempting to open a trouble ticket.  I just want to know how to choose a different compiler version, like in other IDE's.   
    To be clear, I want the same compiler but a newer C++ standard than C++11.  The current one (C++11) won't even compile (for example) the stdio.h definition for FDEV_SETUP_STREAM().
    I realize that VM is wrapping the Arduino's managed build process, and so it may not be so simple.  I was hoping that VM would just have a default and an override in its settings.  Apparently not, based on your previous message.   
    Perhaps I need to create a custom board in order to change the compiler C++ standard version ?  (I'm not sure how to do that yet).  Or there are the settings in platform.txt - any opinions or recommendations on an unobtrusive way to do pick the C++ version ?

P.S.  My VM installation is pretty new (2021.1108.1918), but I don't know if your latest VM version is newer than mine, since your download link does not work (tried 2023.05.03): https://www.visualmicro.com/downloads/Visual.Micro.Arduino.Studio_19.vsix  [apparently fixed the next day]   

P.P.S.:  Also, how can I tell what version of VM is being offered on the web site ?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How do I change the compiler version to C++ 17 (it's now 11) ?
Reply #3 - May 4th, 2023 at 7:26pm
Print Post  
The Visual Micro web site download for VS2022 opens the Microsoft Gallery page. That shows our current version. The releases page on VisualMicro.com also shows the current version.

You are right, the version of Visual Micro is irrelavent for this discussion. The c++ version for build is built into whatever arduino core you are using. That is why we asked for your output and also why we have the yellow highlight at the top of this page. 

The requested output is not attached to your last post. The output would not only show which core you are using but also show how to override the c++ version. 

Overriding the C++ version might or might not work, it depends on how the core you have installed has been designed.

The C++ version for intellisense is best guess by Visual Micro when it inspects the core. There is not an arduino standard that disctates how the c++ version should be delcared. It is up to each core author. The intellisense is discontected from the build system and attempts to work even before you have built the code.

The intellisense for older format Visual Micro projects was an override on top of MSVC. The newer form Visual Micro projects since approx 6 months ago uses a flavour of the Microsoft Linux workload. That gives more accurate intellisense for multiple reasons. I mention this so that you can understand the minor role MSVC has. In fact none with the newer projects. The latest Rc download in this forum is not yet in the gallery but is gallery ready. It contains a new toolbar button only appears when inside old format projects. It provides a simple converter so that you can use the new intellisense.

The new format projects also set the C++ version more accurately than older format projects. You might find that your core is using a new c++ version but the intellisense has made you believe it is not.

It is difficult to give a simle accurate answer without the build output. 

« Last Edit: May 4th, 2023 at 8:30pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint