VS Arduino | |
Visual Micro >> Project Guidance >> Adding Library in Lib
https://www.visualmicro.com/forums/YaBB.pl?num=1462975225 Message started by Sava on May 11th, 2016 at 2:00pm |
Title: Adding Library in Lib Post by Sava on May 11th, 2016 at 2:00pm
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 ;) 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... |
Title: Re: Adding Library in Lib Post by Visual Micro on May 11th, 2016 at 2:10pm
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? |
Title: Re: Adding Library in Lib Post by Sava on May 11th, 2016 at 3:26pm
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 ![]() ![]() |
Title: Re: Adding Library in Lib Post by Visual Micro on May 11th, 2016 at 3:35pm
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 |
Title: Re: Adding Library in Lib Post by Sava on May 11th, 2016 at 7:01pm
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. ;) |
Title: Re: Adding Library in Lib Post by Visual Micro on May 12th, 2016 at 10:41pm
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 |
Title: Re: Adding Library in Lib Post by Sava on May 14th, 2016 at 8:16am
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? |
Title: Re: Adding Library in Lib Post by Visual Micro on May 14th, 2016 at 2:51pm
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 |
Title: Re: Adding Library in Lib Post by Visual Micro on May 14th, 2016 at 10:51pm
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 |
Title: Re: Adding Library in Lib Post by Visual Micro on May 14th, 2016 at 11:24pm
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 |
Title: Re: Adding Library in Lib Post by Visual Micro on May 17th, 2016 at 1:40am
Okay arduino looked into it and the loaded.exe is raising a false positive with mcAffee. So the 101 core is fine.
|
Title: Re: Adding Library in Lib Post by Maarten on Oct 18th, 2016 at 4:08pm
Any update about this case?
I have the same issue here. Greetings Maarten |
Title: Re: Adding Library in Lib Post by Visual Micro on Oct 18th, 2016 at 6:08pm
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 |
Title: Re: Adding Library in Lib Post by Maarten on Oct 19th, 2016 at 11:40am
Restarted Visual Studio 2015 this morning, no error anymore. ::)
Still strange because I restarted the laptop yesterday as well. Anyway I can continue the quest... Best regards, Maarten |
Title: Re: Adding Library in Lib Post by Visual Micro on Oct 19th, 2016 at 11:56am
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 :) 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 :) |
Title: Re: Adding Library in Lib Post by Visual Micro on Jun 27th, 2017 at 11:17am
Off-Topic replies have been moved to this Topic.
|
VS Arduino » Powered by YaBB 2.6.12! YaBB Forum Software © 2000-2025. All Rights Reserved. |