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) Forcing the use of customised libraries (Read 1596 times)
Steven Bennett
Junior Member
**
Offline


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Forcing the use of customised libraries
Aug 12th, 2024 at 12:29pm
Print Post  
When I build a project/solution I want to use a customised version of an Arduino library (to specify a type of LCD) and leave the Arduino version unmodified.  I think the 'Clone for solution when including libraries' will do what I want but I'm unclear how to use it, and whether enabling it is reversible and whether it then affects all projects once enabled.  Is there a clear step-by-step explanation anywhere?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2505
Joined: Feb 13th, 2019
Re: Forcing the use of customised libraries
Reply #1 - Aug 12th, 2024 at 12:42pm
Print Post  
The clone for Project or Solution is one option, though it can accidentally be left enabled and cause confusion.

The simplest answer is to use the Special Folders which are simply folders on disk at the same level as the solution.
https://www.visualmicro.com/page/Special-Folders-and-Portability.aspx

For your use case I would expect the Arduino-Solution/Libraries folder to be the simplest:

e.g. If you have your SLN file as below:
YourSolutionFolder\YourSolution.sln

You can create the folder:
YourSolutionFolder\Arduino-Solution\Libraries

And copy in the library you want to edit and use.  Visual Micro will automatically pick this up after running vMicro > General > Rescan Toolchains and Libraries. or restarting Visual Studio.
  
Back to top
IP Logged
 
Steven Bennett
Junior Member
**
Offline


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #2 - Aug 12th, 2024 at 1:47pm
Print Post  
For some reason this forum truncates file paths, so I have put the full message in the attached file message.txt  I have created a folder  uino-Solution\Libraries and put all the files for TFT_eSPI into the folder.  I have disabled the Arduino library, by renaming it at = xxxTFT_eSPI" but now the build stops abruptly, I have attached the build output.  I am using the following form of include: #include <TFT_eSPI.h>
« Last Edit: Aug 12th, 2024 at 2:17pm by Steven Bennett »  

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


Posts: 2505
Joined: Feb 13th, 2019
Re: Forcing the use of customised libraries
Reply #3 - Aug 12th, 2024 at 2:07pm
Print Post  
If you restart Visual Studio, and run Build > Clean Solution as well this should resolve the issue.
  
Back to top
IP Logged
 
Steven Bennett
Junior Member
**
Offline


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #4 - Aug 12th, 2024 at 2:24pm
Print Post  
I did that but this line occurs in the build output: Using library xxxTFT_eSPI version 2.5.43 by Bodmer in folder E Users Steven Documents GitHub-Arduino_IDE2-Arduino_IDE2_Sketches-libraries-xxxTFT_eSPI which I assume shows it is still using the Arduino based library AND even though it is now misnamed - gosh it's persistent.  Do you know why I can't paste in Windows paths into my posts?
« Last Edit: Aug 12th, 2024 at 2:56pm by Steven Bennett »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2505
Joined: Feb 13th, 2019
Re: Forcing the use of customised libraries
Reply #5 - Aug 12th, 2024 at 3:44pm
Print Post  
Apologies, the folders are case sensitive and must be in lowercase to work as expected (my fault).

Can you close VS, then rename the folders to arduino-solution\libraries, and then try reopening and clean/build the project again?
  
Back to top
IP Logged
 
Steven Bennett
Junior Member
**
Offline


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #6 - Aug 12th, 2024 at 5:07pm
Print Post  
I did the changes but I think it's still looking for the library in the Arduino library location, build runs for less than a second then stops, I've attached the output.  Would you like me to zip up the whole solution folder and send it to you to see if you can reproduce the problem?
  

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


Posts: 2505
Joined: Feb 13th, 2019
Re: Forcing the use of customised libraries
Reply #7 - Aug 12th, 2024 at 7:00pm
Print Post  
Thanks for the update.

If you could send us the whole solution ZIP'd (the .vs folder at the solution level can be excluded).

Also please send the build output as a text file, with the options set shown at the top of the page.
  
Back to top
IP Logged
 
Steven Bennett
Junior Member
**
Offline


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #8 - Aug 13th, 2024 at 9:22am
Print Post  
Hi Simon, build output attached using the arduino-solution method and solution folder minus .vs attached as zip.
  

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


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #9 - Aug 13th, 2024 at 9:52am
Print Post  
I think I've found the problem Simon, I was putting the contents of the library folder into your special folders, not the folder and contents itself.  So now the compilation completes without errors and from the extract from the build output below I assume that the TFT_sSPI library, located in the solution folder, is being used?

Using library TFT_eSPI version 2.5.43 by Bodmer in folder "E: Users Steven Documents GitHub Visual_Micro ESP32 ESP32LCDRound240x240Eyes arduino-solution libraries TFT_eSPI"
« Last Edit: Aug 13th, 2024 at 9:55am by Steven Bennett »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2505
Joined: Feb 13th, 2019
Re: Forcing the use of customised libraries
Reply #10 - Aug 13th, 2024 at 10:21am
Print Post  
Glad to hear you have it working, and I was wondering whether that should have been made clearer.

We will review the documentation and try to make this point more obvious so other users don't run into the same issues.

  
Back to top
IP Logged
 
Steven Bennett
Junior Member
**
Offline


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #11 - Aug 13th, 2024 at 10:33am
Print Post  
Thanks for your help and support Simon.  I've only just started using VM but I also use PlatformIO, STM32CubeIDE et cetera and like those IDEs I have run into a number of issues, some I worked out myself, some from Internet searches and others with your help.  I usually generate a number of text files with the problem and solution, as an aide memoir and I'm going to create one for this issue.  I'll send you them so you can see from a newbie user's perspective the kind of issues that others may come across.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2505
Joined: Feb 13th, 2019
Re: Forcing the use of customised libraries
Reply #12 - Aug 13th, 2024 at 10:54am
Print Post  
No problem at all, and we appreciate the issue reporting and working through the resolution.

If you are happy to share your notes it would be greatly appreciated, if there are any other issues you have encountered with Visual Micro you have notes for they would also be great!
  
Back to top
IP Logged
 
Steven Bennett
Junior Member
**
Offline


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #13 - Aug 13th, 2024 at 11:11am
Print Post  
Attached zip file includes my problem-resolution notes and some URLs I found useful.

I also added a note about a possible mistake in the user guide, not sure if you have seen it, but it's here: https://www.visualmicro.com/forums/YaBB.pl?num=1723375114
« Last Edit: Aug 13th, 2024 at 12:08pm by Steven Bennett »  

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


Posts: 35
Location: High Bentham
Joined: Nov 2nd, 2022
Re: Forcing the use of customised libraries
Reply #14 - Aug 15th, 2024 at 9:02am
Print Post  
Hi Simon,

have you had a chance to look at my notes yet? If I have got anything wrong perhaps you would let me know.

Thanks

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