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) Add Library stopped working? (Read 3941 times)
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Add Library stopped working?
Oct 12th, 2023 at 8:46pm
Print Post  
Something seems to have changed with my installation of Visual Micro in Visual Studio 2022 Community - selecting libraries from the options in the "Add Libraries" menu no longer adds the corresponding header file(s) to my code(?).  This is the case for both built-in libraries, or libraries I've added (mostly for ESP32 development using the Arduino framework).   

I have the same problem trying to add libraries from the Micro Explorer - hovering over an installed library, the tool tip shows "Clicking on this item when a sketch is open..." as I am used to but clicking on the library name does nothing - i.e., no header is added to the open .ino file.

Micro Build Output window content is attached.

Is it possible I changed a setting someplace?  Please tell me what additional information may be helpful to help me get this resolved - thank you!
  

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: Add Library stopped working?
Reply #1 - Oct 12th, 2023 at 9:23pm
Print Post  
Please show  screen shot of the ide after attempting to add a library
« Last Edit: Oct 12th, 2023 at 9:24pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #2 - Oct 12th, 2023 at 10:12pm
Print Post  
Before & after screens attached - thanks for the quick attention!
  

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: Add Library stopped working?
Reply #3 - Oct 12th, 2023 at 10:14pm
Print Post  
The Add Library feature in both Visual Micro and the Arduino IDE adds headers to the [ProjectName].ino code.

Select the the .ino code editor tab to see if the headers are there?

If they are there, you can remove them if you use them in .cpp or .h files and if the .ino code does not use them.
« Last Edit: Oct 12th, 2023 at 10:16pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #4 - Oct 12th, 2023 at 10:19pm
Print Post  
Wrong tab selected in last - apologies, but thanks again for the prompt support...
  

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: Add Library stopped working?
Reply #5 - Oct 12th, 2023 at 10:38pm
Print Post  
What is selected in the solution explorer?
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #6 - Oct 12th, 2023 at 11:49pm
Print Post  
CSSModuleESP32.ino, the main file for the project.   

I took a screen shot but the forum interface lost the attach file fields.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add Library stopped working?
Reply #7 - Oct 13th, 2023 at 12:07am
Print Post  
strange. did you try restarting visual studio?
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #8 - Oct 13th, 2023 at 12:26am
Print Post  
Yes, restarted a couple times.  I will keep looking through my settings, try a couple things, like start a new solution and see if the problem persists.  If so, maybe uninstall/reinstall VM.   

Thanks again for the responsiveness - I will certainly let you know if I learn any clues.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add Library stopped working?
Reply #9 - Oct 13th, 2023 at 6:12pm
Print Post  
The uninstall/reinstall of vm won't help. 

Useful to know if it happens in new projects.

  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #10 - Oct 17th, 2023 at 2:57pm
Print Post  
Tim@Visual Micro wrote on Oct 13th, 2023 at 6:12pm:
The uninstall/reinstall of vm won't help. 

Useful to know if it happens in new projects.



Thanks for saving me the trouble of trying the uninstall/reinstall.

I found the problem does NOT persist when I start a new project, even a new project added to the same solution.  That is, selecting a library to add, either built-in or user added, and from either the tool bar, menu or VM Explorer, successfully adds the proper #include line to the project .ino file.

Hope this helps - happy to provide a solution containing 'working' and 'non-working' project files if they would be of use.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add Library stopped working?
Reply #11 - Oct 17th, 2023 at 4:13pm
Print Post  
Thanks, if you have a project where it's not working then please email the vcxproj
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #12 - Oct 20th, 2023 at 3:31pm
Print Post  
Thanks, Tim - email sent.

One other observation that may help is that selecting a library to add to this project, such as by selecting an installed library from the “Add Library” item on the Visual Micro menu, DOES add the appropriate files to the “External Dependencies” folder in the Solution Explorer.  It just fails to add the # include statement(s).

Hope this helps, and thanks again for the great extension, and for the support.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add Library stopped working?
Reply #13 - Oct 20th, 2023 at 4:46pm
Print Post  
Please remove all the non project code from the project. Then save and send the vcxproj again.

The project code is your code. Exists in proj folder proj\src and folders below the src.

There are two views of the solution. see the little icon above the solution explorer. it helps see more clearly which files are which.

Thanks
« Last Edit: Oct 20th, 2023 at 4:47pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #14 - Oct 20th, 2023 at 5:11pm
Print Post  
Tim,

Sorry, but I do not understand what you mean by "non-project" code.  The only code files in the project folder are the INO (in the root project folder) and then all of my H and CPP files (in the \src folder).  I verified using "Folder View" in the Solution Explorer with "Show All Files" enabled.  I don't see what "non-project" code there is to remove?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add Library stopped working?
Reply #15 - Oct 20th, 2023 at 5:20pm
Print Post  
The vcxproj name is ESP32JSBoard.vcxproj name is and the vs internal project name + ino file are named CSSModuleESP32

They should all be the same. How did you perform the rename?

What is the name of the folder that the vcxproj is in?
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #16 - Oct 20th, 2023 at 5:29pm
Print Post  
I got the problem sorted - nothing wrong with Visual Micro, but learned I have to be careful renaming things.  I had renamed both the Project name (in the Solution Explorer) and the INO file, and the two matched, but renaming the project from inside Visual Studio did NOT rename the underlying vcxproj file.   

Changing the underlying Visual Studio file names to match those displayed in the Solution Explorer fixed the issue - Visual Micro again adds the appropriate include statement(s) when adding a library to the project.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add Library stopped working?
Reply #17 - Oct 20th, 2023 at 5:33pm
Print Post  
Ah great. tip: If you need to rename a project then right click the projectName.ino and then click Rename. Visual Micro implements some workflow to rename everything (project, folder etc) for you.
  
Back to top
IP Logged
 
Zenra
Junior Member
**
Offline


Posts: 37
Joined: Mar 8th, 2017
Re: Add Library stopped working?
Reply #18 - Oct 20th, 2023 at 6:06pm
Print Post  
Good to know, Tim.  Thanks again, and have a great weekend!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint