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 VStudio C++ Libraries not working since installing VMicro for Arduino (Read 513 times)
Ronnie
Newbies
*
Offline


Posts: 6
Joined: Oct 29th, 2024
VStudio C++ Libraries not working since installing VMicro for Arduino
Oct 29th, 2024 at 6:32pm
Print Post  
Hi
I was very excited to find the VMicro extension, allowing me to dispense with the Arduino IDE and use only VStudio for my Arduino Projects. I am an intermediate user.

The issue I am facing is that since I installed the extension, for all projects in VStudio, VStudio no longer recognizes my c++ includes eg. <string> or <iostream>, even adding a new project, eg. desktop c++ project, does not work. 

seems to me the links to the c++ libraries somehow got deleted. I dont know where these are though and reinstalling or repairing VStudio does not help.

Thank you for any help or ideas you can provide.

Build log attached.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VStudio C++ Libraries not working since installing VMicro for Arduino
Reply #1 - Oct 29th, 2024 at 11:55pm
Print Post  
Visual Studio controls the installation of all packages which are installed via "Tools>Get Tools". Visual Micro does not have any control over that and does not tamper with the installation. If the following do not help then run a repair via "windows > add or remove programs > visual studio > repair"

The following might help.

1) Ensure your visual studio is up to date using Help>Check for updates". Microsoft have mad a number of changes to support more modern c++ tools but sometimes if modern packages are installed and the visual studio version is not up to date those changes break things.

2) Visual Micro uses the Linux/Embedded Tools c++ package. Not the C++ desktop package. Therefore, if c++ desktop is not working then ensure it is installed via tools>get tools

3) if you are testing standard c++ projects make sure you do not add a .ino of the same name otherwise that won't be a test of generic visual studio desktop c++ projects.

4) if you are trying to test an arduino project use "File>New>arduino project" or "file>open>arduino project" for the simplest test.

Are you sure the toolchain you have selected, such as desktop c++, have the #includes of <string> or <iostream> instead of <string.h> or <iostream.h>?


« Last Edit: Oct 30th, 2024 at 3:15am by Tim@Visual Micro »  
Back to top
IP Logged
 
Ronnie
Newbies
*
Offline


Posts: 6
Joined: Oct 29th, 2024
Re: VStudio C++ Libraries not working since installing VMicro for Arduino
Reply #2 - Oct 30th, 2024 at 1:10pm
Print Post  
Hi Tim
Many thanks for your reply and suggestions, please allow me to answer on your points:

1. VS is up to date, tried with both v 17.11 and v17.12.0 Preview 5.0.
2. Both Desktop development with C++ and Linux and embedded development with C++ are installed in tools.
3. My project consists of several files, the main .ino, and several classes, divided into .h and .cpp files, the c++ libraries includes are not recognized in any of these, all #include statements i would usually use <iostream>, <string> are highlighted as error "cannot open source file". 
4. Have tried this, no luck. However when i start any other type of c++ project, desktop or console or empty, they all work - this is why i believe it has something to do with Vmicro.
5. Yes, I have always used <string> and <iostream> instead of their variants with .h at the end.

I really appreciate the help as im very much looking forward to using this extension - assuming I can get it to work!

Ronald

Also, I have already tried a VIsual Studio Repair, which also did nothing.

  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: VStudio C++ Libraries not working since installing VMicro for Arduino
Reply #3 - Oct 30th, 2024 at 1:36pm
Print Post  
Thanks for the detail and the update.

As the compiler also rejects the #include <string> in both vMicro and Arduino IDE, it seems best to use the #include <string.h> file, which is found in the toolchain.

In desktop C++ projects these headers come from the VC++ toolchain installed by Visual Studio, however when using Visual Micro we have to use the toolchain included with each board package.

It is likely that some boards support both variants of the headers (e.g. ESP32 allows <string>), whereas the ATMega2560 only seems to support the *.h file, as it is the only one included.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint