Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio

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 and Verbose
  • 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
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
Page Index Toggle Pages: 1
Send Topic Print
Intellisense for Libraries - ESP8266WiFi #include in .cpp (Read 4452 times)

Posts: 1
Intellisense for Libraries - ESP8266WiFi #include in .cpp
Jun 28th, 2016 at 8:29pm
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
Back to top
« Last Edit: Jun 28th, 2016 at 8:45pm by Tim@Visual Micro »  
IP Logged
Tim@Visual Micro

Posts: 11529
United Kingdom
Re: Intellisense for Libraries - ESP8266WiFi #include in .cpp
Reply #1 - Jun 28th, 2016 at 8:44pm

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

Back to top
« Last Edit: Jun 28th, 2016 at 8:45pm by Tim@Visual Micro »  

Tim Leek
IP Logged
Page Index Toggle Pages: 1
Send Topic Print