Visual Studio Ide for Arduino
https://www.visualmicro.com/forums/YaBB.pl
Other >> Project Guidance >> Remove unused libraries from Visual Studio project
https://www.visualmicro.com/forums/YaBB.pl?num=1441189373

Message started by Anton Kalcik on Sep 2nd, 2015 at 11:22am

Title: Remove unused libraries from Visual Studio project
Post by Anton Kalcik on Sep 2nd, 2015 at 11:22am
How can I remove unused libraries from my Visual Studio project I already referenced via Visual Micro -> Add Library?

UPDATE:
I see: In *.vcxproj file is in the <AdditionalIncludeDirectories/> the path to corresponding libraries. But is it also possible to remove it with the help of GUI?

Title: Re: Remove unused libraries from Visual Studio project
Post by Visual Micro on Sep 2nd, 2015 at 12:35pm
Hi,

This works the same way the Arduino ide works. The #includes from the .ino files are parsed and lib paths deduced.

This means that removing #includes removes libraries

All the "Add Lib" command does is to add the #includes

Title: Re: Remove unused libraries from Visual Studio project
Post by Anton Kalcik on Sep 2nd, 2015 at 12:44pm
Ah thank you. But i would like to use (regarding my question http://www.visualmicro.com/forums/YaBB.pl?num=1440772413) the copies of libraries to be able check them into source code repository. But when I include them (#include) always is used path to the personal library (..\Users\[Username]\Documents\Arduino\libraries) in the <AdditionalIncludeDirectories/>

Title: Re: Remove unused libraries from Visual Studio project
Post by Visual Micro on Sep 2nd, 2015 at 12:49pm
I'm sorry I don't understand what you are trying to achieve.

I have explained how arduino libraries work and where they must be located and that we will be extending the system in the not too distant future to give more fleixbility.

Title: Re: Remove unused libraries from Visual Studio project
Post by Anton Kalcik on Sep 2nd, 2015 at 1:06pm
I copied the libraries from my arduino personal library folder in the project folder. I hoped when I replace in the <AdditionalIncludeDirectories/> the paths to the arduino personal library  with the paths to the project folder the preprocessor would search there. But as soon as I compile the project the paths to the arduino personal library folder are re-added again.

Title: Re: Remove unused libraries from Visual Studio project
Post by Visual Micro on Sep 2nd, 2015 at 1:13pm
I see thanks.

Have you placed the libs in the sketch folder or in a sub folder of the sketch?

Title: Re: Remove unused libraries from Visual Studio project
Post by Anton Kalcik on Sep 2nd, 2015 at 1:52pm
See below the structure. The files are in the Libraries folder, which is the subfolder of sketch folder.

ArduinoProject

--Debug
--Libraries
----Adafruit_nRF8001
----Adafruit-GFX
----Adafruit-SSD135
----CmdMessenger
--Visual Micro

ArduinoProject.ino
ArduinoProject.vcxproj
ArduinoProject.vcxproj.filters

Title: Re: Remove unused libraries from Visual Studio project
Post by Visual Micro on Sep 2nd, 2015 at 2:01pm
Sorry if I have not been clear.

That structure is not Arduino compatible. Arduino only supports source code in the sketch folder or in the "official" libraries folders.

There will be some additional Visual Micro options available shortly that will allow you to break the Arduino rules and do things like that.

Title: Re: Remove unused libraries from Visual Studio project
Post by Anton Kalcik on Sep 2nd, 2015 at 2:20pm
No problem. Thank you very much for your help, I appreciate your support and your work!

Title: Re: Remove unused libraries from Visual Studio project
Post by Visual Micro on Sep 8th, 2015 at 4:28pm
If you have the Pro version of Visual Micro enabled, in the latest release you can place local libraries in a designated folder and also use sub folders for sketch code. Local libraries override std libraries of the same name which means you can use the same system to edit or experiment with existing libraries, not just new ones.

There is a new "Item>Add>New Arduino Library" option which will create a new library in the current project and demonstrate the correct folder structure which is "_micro-api\libraries\LibName". Keep in mind there are two Arduino lib formats. The example creates the latest format but you can also use the older simpler format.

Title: Re: Remove unused libraries from Visual Studio project
Post by Anton Kalcik on Sep 9th, 2015 at 2:04pm
Great news thank you!

Visual Studio Ide for Arduino » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2019. All Rights Reserved.