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 Add custom path to library (Read 4613 times)
xmen
Junior Member
**
Offline


Posts: 56
Joined: Aug 22nd, 2016
Add custom path to library
Jan 29th, 2017 at 8:28am
Print Post  
I have a separate folder where I keep all my library and I want to reference to it. The VS doesn't show error but it fails when compiling. Can this be solved ? Maybe an option to select a separate lib folder directory.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add custom path to library
Reply #1 - Jan 29th, 2017 at 12:20pm
Print Post  
You should use the new shared project support in vs2015 and above. It also supports library projects.

Shared projects can be located anywhere not just in the usual arduino locations. A shared project that contains a library.properties in the root is considered to be an arduino library.

Visual Micro will create an example for you if you enable the new "create a project when a library is selected" menu   checkbox on the Add Library menu. Switch it on and then select any arduino library as if adding to the current sketch code.



You can copy the resulting library project to a different location and then add it back into your solution. Then you just need to add it as a "Reference" to you sketch project.

With this combination visual micro will compile the library as a normal arduino library. If it has the same name as an existing arduino library the existing will be ignored. So you can add new or override any arduino library and locate in any folder. 

Code usage is standard arduino library #include syntax.

tip: this example uses an arduino library from below the arduino ide folder, which is not recommenced unless it is used as read/debug only. Ideally, copy the library to another location


You can also create shared projects from scratch (manually) using standard visual studio "file>new>project>c++>misc>shared project".
« Last Edit: Jan 29th, 2017 at 12:27pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Add custom path to library
Reply #2 - Jan 30th, 2017 at 3:44pm
Print Post  
By the way I assumed you know about the arduino user libs folder?

Normally it is "documents\arduino\libraries"

The "documents\arduino" part is known as the Arduino SketchBook folder and a \Libraries" sub folder is supported.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint