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
Normal Topic Compile fails with ESP8266WebServer.h in a cpp file (Read 5531 times)
John21
Junior Member
**
Offline


Posts: 13
Joined: Nov 11th, 2013
Compile fails with ESP8266WebServer.h in a cpp file
Jul 3rd, 2015 at 6:44pm
Print Post  
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.
« Last Edit: Jul 3rd, 2015 at 9:33pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile fails with ESP8266WebServer.h in a cpp file
Reply #1 - Jul 3rd, 2015 at 9:34pm
Print Post  
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
Joined: Nov 11th, 2013
Re: Compile fails with ESP8266WebServer.h in a cpp file
Reply #2 - Jul 4th, 2015 at 3:36pm
Print Post  
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!
« Last Edit: Jul 4th, 2015 at 3:38pm by John21 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile fails with ESP8266WebServer.h in a cpp file
Reply #3 - Jul 4th, 2015 at 3:47pm
Print Post  
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
« Last Edit: Jul 4th, 2015 at 3:48pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint