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
Sticky Topic Intellisense for Libraries - ESP8266WiFi #include in .cpp (Read 5171 times)
lukasz
Newbies
*
Offline


Posts: 1
Joined: Jun 28th, 2016
Intellisense for Libraries - ESP8266WiFi #include in .cpp
Jun 28th, 2016 at 7:29pm
Print Post  
Hello, I have a problem with ESP8266WiFi library. If i include like here #include <ESP8266WiFi\src\WiFiClient.h> IDE shows my code fine and i can normally write, but when i want to compile there are undefined reference errors. When i change including style to #include <ESP8266WiFi.h> and i check-in Deep Search it compiles normally, but IDE underlines a lot of my code as error and i can't work normally. I would be grateful if you will repair this bug Smiley
PS I have visual studio 2015
« Last Edit: Jun 28th, 2016 at 7:45pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense for Libraries - ESP8266WiFi #include in .cpp
Reply #1 - Jun 28th, 2016 at 7:44pm
Print Post  
Hi,

Yes for Arduino you must include #include <ESP8266WiFi.h> which will automatically discover the correct location.

The deep search is a new feature in the Arduino Ide and also in Visual Micro. It is a slow system but avoided new users needing to know one useful historic Arduino fact...

Historically, all Arduino library #includes must be in the project_name.ino even if they are only used in .cpp files. I am assuming you have included the lib in your .cpp file but not in the .ino code.

Because "deep search" is so slow it is not a practical solution for intellisense purposes so a caching system is being developed. It's complicated, prone to problems and still requires some searching when libraries are added to projects or new projects are created so the current recommendation is to ensure the #include is in the <project_name.ino>. 

Click save or build after adding the #include which forces an intellisense refresh alternatively use the Visual Micro "Add Library" facility which adds the #includes and performs the save.

The other benefit of adding the #includes to the .ino is that unless you have conditional #includes (surrounded by #if) you will not need Deep Search enabled and the build will be faster.

This link will be updated when things change


« Last Edit: Jun 28th, 2016 at 7:45pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint