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) Adding Library in Lib (Read 24771 times)
Sava
Newbies
*
Offline


Posts: 4
Joined: May 11th, 2016
Adding Library in Lib
May 11th, 2016 at 2:00pm
Print Post  
Hi,

for a a project I am writting my own library. In it's header I want to add another library, so it's start with:

#include <Arduino.h>
#include <Servo.h>

I use visual micro with Visual Studio 2015 and test the code with the uno and the 101.

When I build the project for the 101, I get the Warning: "Servo.h: No such file or directory", when I build the project for the uno, I get no warning at all... and building ends with no problem shown. And also the uploading shows no problem. 

Unforthantly I can not use the Uno for the project (it is only a sparfun redstick), because I the end I want to use the BLE capabilities of the 101...

When I use the same code base with the arduino IDE and the 101 building and uploading works normal and get a totally other error... I really would like to debug with the visual micro Wink

A hint when adding #include <Servo.h>, I get the hint to use <Servo/Servo.h> or similar... <Servo/src/Servo.h> or a third version, but none of them works...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #1 - May 11th, 2016 at 2:10pm
Print Post  
Hi,

I will give you some info and let me know your findings.

1) Before late last year if you #include another library from a library then you must also ensure that the #include exists in the [project_name].ino. This is typically the most efficint way for Arduino to find all libs and still applies to both the Arduino Ide and Visual Micro.

2) End of last year Arduino introduced a new system to auto-discover libraries in other libraries. This feature is optional in Visual Micro and can be enabled/disabled using menu item "vMicro>Deep Search Includes"

Summary

If you have 2) enabled in Visual Micro (default is enabled) then I would not have expect to see the error you report with missing indirect lib #include. If it is enabled and you see this error then I will look at why Visual Micro isn't performing "deep search" for the 101 tool chain.

Deep search slows the compile times which is why for more experienced users I suggest switching it off and #including all libs in the .ino even if only used in .cpp code. 

Historically new users, for example, do not understand that if a library requires "spi.h" then it must be included in the .ino code. So this feature is mainly to prevent the errors for new users.


So the initial questions are, is deep search enabled? and if you include the related header in the .ino code does it build okay?
  
Back to top
WWW  
IP Logged
 
Sava
Newbies
*
Offline


Posts: 4
Joined: May 11th, 2016
Re: Adding Library in Lib
Reply #2 - May 11th, 2016 at 3:26pm
Print Post  
Hi, as you can hopefully see deep search is included. The When building for the uno instead of 101 the the read underline everything seams to be ok.

Attachment 1... built for 101
Attachment 2... built for Uno
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #3 - May 11th, 2016 at 3:35pm
Print Post  
Let me say that intellisense and build are two different things.

Let's ignore the Uno project because I think you are saying it is working fine.

For the 101 project:-

1)
Please confirm if it builds okay and that you are reporting intellisense errors?

or

2)
It does not build?


If the build fails then please copy and paste the output (ausgabe) (not error window image) into this thread

Thanks
« Last Edit: May 11th, 2016 at 3:59pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Sava
Newbies
*
Offline


Posts: 4
Joined: May 11th, 2016
Re: Adding Library in Lib
Reply #4 - May 11th, 2016 at 7:01pm
Print Post  
Hi, the output from building for the 101 ends with:

RobotArm.cpp:In file included from
RobotArm.h:5:19: fatal error: Servo.h: No such file or directory
:#include <Servo.h>
:compilation terminated
Error compiling libraries

Hopefully it is the thing you wanted.

Thank. Wink
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #5 - May 12th, 2016 at 10:41pm
Print Post  
Hi,

Can you confirm your visual micro version? Have you been keeping it up to date?

All the hardware manufacturers have been making huge updates as has the Arduino IDE team.

Please tell me the version you using from tools>extensions and updates>arduino ide for vs>version

Thanks
  
Back to top
WWW  
IP Logged
 
Sava
Newbies
*
Offline


Posts: 4
Joined: May 11th, 2016
Re: Adding Library in Lib
Reply #6 - May 14th, 2016 at 8:16am
Print Post  
Hi,

I had enshured, that the Arduino IDE was up to date, before I wrote...  Also the boards...
Yesterday I updated Visual Studio (and visual micro). Due to the lattest update the error message changed to:

In file included from C:\Users\Sebastian\Documents\Arduino\libraries\RobotArm\RobotArm.cpp:4:0:
C:\Users\Sebastian\Documents\Arduino\libraries\RobotArm\RobotArm.h:5:19: fatal error: Servo.h: No such file or directory
#include <Servo.h>
                   ^
compilation terminated.

An error was encountered during the 'Deep Search' discovery process.
Either resolve the error or switch off the 'Deep Search Includes' option.
     Tip: When deep search is switched off, headers must be #included in the [project_name.ino] for all required libraries (for example: #include <SPI.h>)
     Tip: Deep search must be off if the project source contains links/shortcuts to code outside of the project structure. The source will have been #included using a relative path preceeded by ..\ (for example: #include "..\..\foo\foo.h")

Has someone encountered the same problem for the board?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #7 - May 14th, 2016 at 2:51pm
Print Post  
Thanks.

Please switch on "tools>options>visual micro>compiler>show build properties" and also the "verbose" option.

Then click "Build>clean solution"

Then build and email the output to info [at] visualmicro.com

Thanks
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #8 - May 14th, 2016 at 10:51pm
Print Post  
Hi,

Thanks for the output. The deep search is failing which I will look into.

However, a workaround is to add #include <Servo.h> to the [project_name].ino it will work.

tip: if you always add #includes for any required libs to the [project_name].ino then you can work with "deep search" switched off which improves build times (substantially in some cases). 

nb: First compile after altering the switch is always a full build

« Last Edit: May 14th, 2016 at 10:51pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #9 - May 14th, 2016 at 11:24pm
Print Post  
Update 2.

I have suspended testing with the Arduino 101 v1.0.5 core because my virus checker reports it contains a trojan.

I hope it is a false positive but have logged an issue with the Arduino IDE team:-

https://github.com/arduino/Arduino/issues/4952
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #10 - May 17th, 2016 at 1:40am
Print Post  
Okay arduino looked into it and the loaded.exe is raising a false positive with mcAffee. So the 101 core is fine.

  
Back to top
WWW  
IP Logged
 
Maarten
Newbies
*
Offline


Posts: 2
Joined: Oct 16th, 2016
Re: Adding Library in Lib
Reply #11 - Oct 18th, 2016 at 4:08pm
Print Post  
Any update about this case?
I have the same issue here.

Greetings Maarten
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #12 - Oct 18th, 2016 at 6:08pm
Print Post  
Hi, this was resolved in builds of last few months. 

Can you please state the version you are using from "tools>extensions and updates"

Thanks
  
Back to top
WWW  
IP Logged
 
Maarten
Newbies
*
Offline


Posts: 2
Joined: Oct 16th, 2016
Re: Adding Library in Lib
Reply #13 - Oct 19th, 2016 at 11:40am
Print Post  
Restarted Visual Studio 2015 this morning, no error anymore.  Roll Eyes

Still strange because I restarted the laptop yesterday as well. Anyway I can continue the quest...

Best regards,
Maarten
« Last Edit: Oct 19th, 2016 at 11:50am by Maarten »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #14 - Oct 19th, 2016 at 11:56am
Print Post  
Maybe the latest virus checkers are picking it up again. It only relates to an .exe used for esp8266 spiffs upload so if your virus checker removed the file yesterday you wouldn't see the error today.

It's also possible that the visual studio auto update installed a new version of visual micro yesterday or today which further confuses us Smiley

I will do some more testing at the weekend. It's annoying that a simple .exe is so difficult. Maybe it's time to add a signature to the .exe's but that makes the build and deployment more difficult. 

I have my fingers crossed that it's okay now Smiley
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding Library in Lib
Reply #15 - Jun 27th, 2017 at 11:17am
Print Post  
Off-Topic replies have been moved to this Topic.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint