Visual Studio Ide for Arduino
https://www.visualmicro.com/forums/YaBB.pl
Other >> Arduino for Visual Studio 2010 >> Compile fails with ESP8266WebServer.h in a cpp file
https://www.visualmicro.com/forums/YaBB.pl?num=1435949075

Message started by John21 on Jul 3rd, 2015 at 7:44pm

Title: Compile fails with ESP8266WebServer.h in a cpp file
Post by John21 on 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.

Title: Re: Compile fails with ESP8266WebServer.h in a cpp file
Post by Visual Micro on 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"

Title: Re: Compile fails with ESP8266WebServer.h in a cpp file
Post by John21 on 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!

Title: Re: Compile fails with ESP8266WebServer.h in a cpp file
Post by Visual Micro on 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

Visual Studio Ide for Arduino » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2019. All Rights Reserved.