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) Added library not shown in source files - (Solved using shared project) (Read 4202 times)
Red Baron
Member
***
Offline


Posts: 106
Location: Germany
Joined: Jul 29th, 2015
Added library not shown in source files - (Solved using shared project)
Apr 10th, 2017 at 3:36pm
Print Post  
Hi,

mostly I use menu vMicro -> "Toggle Hidden Files" to have access to the source files. Often the modules are not well documented so it's great to have a look at the implementation.

When you add a new libraray, this is not automatically shown in the source folders. You have to switch off the display of the sources and switch it on again. Please do this internally when adding libraries.

Kind regards

Redbaron
« Last Edit: Apr 27th, 2017 at 7:09pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Added library not shown in source files
Reply #1 - Apr 10th, 2017 at 3:40pm
Print Post  
Which IDE?
  
Back to top
WWW  
IP Logged
 
Red Baron
Member
***
Offline


Posts: 106
Location: Germany
Joined: Jul 29th, 2015
Re: Added library not shown in source files
Reply #2 - Apr 10th, 2017 at 4:50pm
Print Post  
sorry, I forgot.

VM Version: 1.1702.15

Microsoft Visual Studio Community 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Added library not shown in source files
Reply #3 - Apr 10th, 2017 at 7:32pm
Print Post  
Thanks for the report I will look into it.

The issue is a result of a newer better system for including libraries along with their source code.

If you have a licensed system then it's a better option to use the new checkbox on the add library menu. If you don't have a license them you can create a standard visual studio shared project and copy library sources into it or move it to a library location.

Select a library when you have the checkbox enabled and it will be added to the solution as a visual studio shared project. Then right click references in your main project and click "add reference>shared project".

You will see you library project in the list and can add as a reference. There are many benefits to looking into this way of working and you will find you can move or copy the library to any location on your pc (you have to remove and re-add to the solution if you change the location). 

Arduino Shared Library Projects Documentation







« Last Edit: Apr 27th, 2017 at 6:37pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Red Baron
Member
***
Offline


Posts: 106
Location: Germany
Joined: Jul 29th, 2015
Re: Added library not shown in source files
Reply #4 - Apr 27th, 2017 at 2:36pm
Print Post  
Sorry for my late answer, I was traveling.

That's a very fine option and works great.
  
Back to top
 
IP Logged
 
Red Baron
Member
***
Offline


Posts: 106
Location: Germany
Joined: Jul 29th, 2015
Re: Added library not shown in source files
Reply #5 - Apr 27th, 2017 at 5:48pm
Print Post  
Hi,

I was too euphoric. If you look more closely, you can see that there are many intellisense errors.
« Last Edit: Apr 27th, 2017 at 7:09pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Added library not shown in source files
Reply #6 - Apr 27th, 2017 at 6:36pm
Print Post  
Have you added the shared projects as References to your main project?

It's described in the link I posted above the images but here is a more obvious image









« Last Edit: Apr 27th, 2017 at 6:39pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Red Baron
Member
***
Offline


Posts: 106
Location: Germany
Joined: Jul 29th, 2015
Re: Added library not shown in source files
Reply #7 - Apr 27th, 2017 at 6:53pm
Print Post  
Aaaahhh! Thx! Now it looks nice!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Added library not shown in source files
Reply #8 - Apr 27th, 2017 at 7:08pm
Print Post  
Great. 

It's important to realize that the hardware/board in shared projects is derived from the "Startup Project", the real Arduino project. 

If you had two Arduino projects in the solution with both sharing the same library and both using different boards The project that is the "Startup Project" will be used for intellisense.

This is why you need to "Add" the "Reference" (also allows the compilation to discover the library when it is located outside of normal Arduino library folders).
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint