Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
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....
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
Compile fails with ESP8266WebServer.h in a cpp file (Read 4283 times)
John21
Junior Member
**
Offline



Posts: 13
Compile fails with ESP8266WebServer.h in a cpp file
Jul 3rd, 2015 at 7:44pm
 
I'm also using 1.6.4 and the latest version of Visual Micro. I ran into a related issue with #include <ESP8266WebServer.h> that has me very perplexed. Using this include in the .ino file works without problems. For me it doesn't break Intellisense.

However, when I use the include in a .cpp file (which is under the Source Files filter), I get this error message in the Output window:

fatal error: ESP8266WebServer.h: No such file or directory

I can use other includes, such as <ESP8266WiFi.h> without problems. It's only ESP8266WebServer.h that is causing problems. Any ideas?

This is using version 1.6.4-673-g8cd3697 of the esp8266 package.
Back to top
« Last Edit: Jul 3rd, 2015 at 10:33pm by Visual Micro »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: Compile fails with ESP8266WebServer.h in a cpp file
Reply #1 - Jul 3rd, 2015 at 10:34pm
 
Hi,

You need to include the esp8266wifi.h and the webserver in the sketchname.ino

Then you can use them in cpp files.

The webserver uses these includes

#include <Arduino.h>
#include "WiFiServer.h"
#include "WiFiClient.h"
#include "ESP8266WebServer.h"
Back to top
 
WWW  
IP Logged
 
John21
Junior Member
**
Offline



Posts: 13
Re: Compile fails with ESP8266WebServer.h in a cpp file
Reply #2 - Jul 4th, 2015 at 4:36pm
 
Ah, I get it now. I didn't realize I needed to add the include into the .ino before I had to add it into the .cpp file. It works now. Thanks!
Back to top
« Last Edit: Jul 4th, 2015 at 4:38pm by John21 »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: Compile fails with ESP8266WebServer.h in a cpp file
Reply #3 - Jul 4th, 2015 at 4:47pm
 
Great, thanks for the update. Please try to post a pic of your project in vs on esp8266.com when you get a spare mo
Back to top
« Last Edit: Jul 4th, 2015 at 4:48pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print