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 Cannot find SD.h in a ClearCore project - Works fine in Arduino IDE (Read 215 times)
Clough
Newbies
*
Offline


Posts: 4
Joined: Dec 15th, 2024
Cannot find SD.h in a ClearCore project - Works fine in Arduino IDE
Dec 15th, 2024 at 8:37pm
Print Post  
I'm using Visual Micro in Visual Studio 2022 to build for the Teknic ClearCore, so I have the ClearCore board definition loaded, and also one other library (genieArduinoDEV).  That's all working, but I can't seem to use the standard Arduino SD library.  When I try to #include <SD.h> the compiler just complains that it can't find that header file.  (build output attached)

The same code compiles just fine in the Arduino 2 IDE.  I have tried both the "Arduino 2" and "Visual Micro (no IDE)" application configs.  I have also installed the Arduino SD library in Visual Micro, with no luck.

After reading what I could find in the forums, I'm starting to suspect this is a name collision with one of the libraries included with the ClearCore board definition.  It does indeed have a (dummy) library called SD, which has only a dummy header.  I've tried all kinds of things, like editing the include directories in the Visual Studio project, but the include directory I keep adding for the Arduino SD library keeps getting deleted, and I see no mention of it in the build output.

If I #include <SD.h> I can see that it's including the ClearCore SD directory in the include path, and if I take out the #include, that path is no longer included, so I suspect this is a name collision issue.

Is there a way I can work around this and include the Arduino SD library?

I really want to maintain compatibility with the Arduino IDE because this is open source code and I want people to be able to use it easily without needing Visual Micro or Visual Studio.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Clough
Newbies
*
Offline


Posts: 4
Joined: Dec 15th, 2024
Re: Cannot find SD.h in a ClearCore project - Works fine in Arduino IDE
Reply #1 - Dec 16th, 2024 at 4:29pm
Print Post  
This does seem to be the case: there is an SD library in the ClearCore package.  It doesn't have an actual library in it, but rather it's an example showing how to read and write the SD card.

If I rename that folder from SD to SDExample, then Visual Micro can properly find the real Arduino SD library.

This doesn't seem to be an issue for the Arduino IDE.  Is there a configuration change I can make to Visual Micro to make it find the real SD library and not give up after finding the SD example in the ClearCore package?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2499
Joined: Feb 13th, 2019
Re: Cannot find SD.h in a ClearCore project - Works fine in Arduino IDE
Reply #2 - Dec 16th, 2024 at 4:34pm
Print Post  
Thanks for the update, we are actively investigating why the dummy SD library included with ClearCore is affecting the sketchbook library being found, although their included library does match Architecture better, it does not contain the SD.h file the #include references:
https://arduino.github.io/arduino-cli/1.1/sketch-build-process/#dependency-resol...

One option in the interim is to use the Special Folders feature in Visual Micro and copy the correct SD Library to the arduino-solution\libraries\SD\ folder.
Documentation: https://www.visualmicro.com/page/Special-Folders-and-Portability.aspx

As this is simply a folder on disk it can easily be undone once we have the fix available.
« Last Edit: Dec 16th, 2024 at 4:51pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Clough
Newbies
*
Offline


Posts: 4
Joined: Dec 15th, 2024
Re: Cannot find SD.h in a ClearCore project - Works fine in Arduino IDE
Reply #3 - Dec 17th, 2024 at 3:26am
Print Post  
Thank you for the response.  I'm looking forward to a potential fix.

(I thought I replied earlier, but don't see it here, so I'm trying again.)
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2499
Joined: Feb 13th, 2019
Re: Cannot find SD.h in a ClearCore project - Works fine in Arduino IDE
Reply #4 - Dec 20th, 2024 at 3:40pm
Print Post  
Can you install the latest release (24.1211.4) from the top of the board below:
https://www.visualmicro.com/forums/YaBB.pl?board=vs_arduino_ext_releases

This should resolve the issue you were having with the SD Library not being found.
  
Back to top
IP Logged
 
Clough
Newbies
*
Offline


Posts: 4
Joined: Dec 15th, 2024
Re: Cannot find SD.h in a ClearCore project - Works fine in Arduino IDE
Reply #5 - Dec 20th, 2024 at 10:07pm
Print Post  
Simon@Visual Micro wrote on Dec 20th, 2024 at 3:40pm:
This should resolve the issue you were having with the SD Library not being found.


Thank you.  I can confirm this fixed my issue.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint