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
Hot Topic (More than 8 Replies) Standard Arduino Libraries aren't found (Read 1492 times)
dinotomFL
Junior Member
**
Offline


Posts: 25
Location: Florida
Joined: Mar 28th, 2016
Standard Arduino Libraries aren't found
Apr 15th, 2022 at 10:37am
Print Post  
I am using VS2022 Enterprise and have installed VM for VS2022. I had used VM years ago on an Arduino project, so felt I should give it a try in VS2022. 

I have taken my working code from the Arduino IDE and ported it to VM project.

I have a few issues, for starters, the standard libraries, such as Wire.h, SD.h, SPI.h, SoftwareSerial.h etc, etc aren't found. when you click on AddLibrary and go to All Built-In and click on them, the IDE still shows them in red and the error says they aren't in any path.

Importing external libraries has the same issue. If I go to AddLibrary and install an Arduino library from zip, it completes and says it is now installed, please rescan/refresh. Once I rescan AND refresh, those includes are still red with the same, "not in paths" error.

Here is the build output
Quote:
Compiling 'AutomaticRouterFenceWithOpticalEndStops' for 'ATmega2560 (Mega 2560) (Arduino Mega)'
Build Folder: EndStops/mega_atmega2560/Release"
Summary: Header=1 Prototypes=1 Imports=0
Additional Defines: 
Architecture Tools: 0-atmel3.6.1-arduino7/bin/"
Api: 1.2022.0218-5
Sketch Book: "file:///C:/Users/Tr/OneDrive/Documents/Arduino"
Sketch Include Paths
Core Include Paths
Include Path /cores/arduino"
Include Path /variants/mega"
 
Deep search for libraries ...
.6.1-arduino7\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560   -DF_CPU=16000000L -DARDUINO=108016 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR \arduino" nts\mega" \mega_atmega2560\Release\AutomaticRouterFenceWithOpticalEndStops.cpp.interim" -o "nul"
.6.1-arduino7\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560   -DF_CPU=16000000L -DARDUINO=108016 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR \arduino" nts\mega" \mega_atmega2560\Release\AutomaticRouterFenceWithOpticalEndStops.cpp.interim" -o "nul"
 
AutomaticRouterFenceWithOpticalEndStops.ino: 56:10: fatal error: cstdint: No such file or directory
   #include <cstdint>
« Last Edit: Apr 15th, 2022 at 1:27pm by dinotomFL »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Standard Arduino Libraries aren't found
Reply #1 - Apr 15th, 2022 at 9:25pm
Print Post  
Hi

Please follow the guide in the yellow box above.

Thanks
  
Back to top
WWW  
IP Logged
 
dinotomFL
Junior Member
**
Offline


Posts: 25
Location: Florida
Joined: Mar 28th, 2016
Re: Standard Arduino Libraries aren't found
Reply #2 - Apr 15th, 2022 at 9:44pm
Print Post  
I did change the setting and recompile, and the output is in the post. When I return home later I will send as a txt file, if that’s required.
  
Back to top
 
IP Logged
 
dinotomFL
Junior Member
**
Offline


Posts: 25
Location: Florida
Joined: Mar 28th, 2016
Re: Standard Arduino Libraries aren't found
Reply #3 - Apr 15th, 2022 at 10:01pm
Print Post  
Here is the compiled output as a txt file.

One other thing to note, the error shown in the output from
#include <csdint> 
was added by VS as an error correction to use uint16_t type
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
dinotomFL
Junior Member
**
Offline


Posts: 25
Location: Florida
Joined: Mar 28th, 2016
Re: Standard Arduino Libraries aren't found
Reply #4 - Apr 17th, 2022 at 9:52pm
Print Post  
Nothing I could do would solve this, so I went with the standard when nothing works. I totally uninstalled everything Arduino related and reinstalled from a fresh zip downloaded from arduino.cc. That has now solved my issue where the standard Arduino libraries were not available. 

I then went to important my Nextion library, and despite my uninstall, it said it was already installed. You can see it in the screenshot. I right clicked on it to try to delete it so I could install it fresh, but it added all the .h files (you see them in red on my VS instance). I recompiled, the output is attached. Not sure how when VM is adding the includes, from a library IT IMPORTED, they aren't recognized.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Standard Arduino Libraries aren't found
Reply #5 - Apr 17th, 2022 at 11:56pm
Print Post  
Hi

1)

Please switch on "Show Build Properties" so that we have the properties alongside the verbose. See yellow box above for guide.

As a test also close the ide, delete the following folder then reopen and build
ops


2)

This is not valid for arduino #include <csdint>

The vs intellisense sometimes gets it wrong. We can often add patches to prevent that and will look at the for avr.

  
Back to top
WWW  
IP Logged
 
dinotomFL
Junior Member
**
Offline


Posts: 25
Location: Florida
Joined: Mar 28th, 2016
Re: Standard Arduino Libraries aren't found
Reply #6 - Apr 18th, 2022 at 12:31am
Print Post  
I also installed the latest Nextion library as I need something that is in that version and not the original version I imported first. How can I delete the first version I imported? I can't seem to find a way to delete any imported libraries. I believe once that's accomplished, I'll be good as the remaining errors relate to the code from the latest library.

Ok I figured that one out. Now VM is erring on function calls as seen in screen shot where the actual function is at the bottom and is error free.
« Last Edit: Apr 18th, 2022 at 12:45am by dinotomFL »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Standard Arduino Libraries aren't found
Reply #7 - Apr 18th, 2022 at 12:37am
Print Post  
The reason we ask for the information in yellow is so that we can answer questions. The output will show us how the library is being referenced. You have not made that clear.

For a normal arduino project the libraries are installed into mydocuments/arduino/libraries. Deleting them is just a matter of removing the /[library_name] folder. After that in Visual Micro click "vMicro>general?rescan toolchains" or restart the ide.

If you have added the reference as a shared library then removing it is simply a metter of removing the reference from the arduino project.

Does this help?
  
Back to top
WWW  
IP Logged
 
dinotomFL
Junior Member
**
Offline


Posts: 25
Location: Florida
Joined: Mar 28th, 2016
Re: Standard Arduino Libraries aren't found
Reply #8 - Apr 18th, 2022 at 12:57am
Print Post  
Yes, as noted above, I figured out how to delete the libraries. Now I have the problem shown in the screenshot above where valid functions aren't being recognized. My use of C++ is limited, so it maybe be own unfamiliarity of how VS2022 works with C++. I primarily write in C# or occasionally, python.

Thank you for the help and Happy Easter.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint