Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "'ESP' does not name a type ESP *esp;" #41

Open
janpaul1992 opened this issue Oct 28, 2015 · 3 comments
Open

Error "'ESP' does not name a type ESP *esp;" #41

janpaul1992 opened this issue Oct 28, 2015 · 3 comments

Comments

@janpaul1992
Copy link

Hi, recently I tried to use this project for communicating with a rest api. I downloaded the library and loaded the example but something is wrong. The arduino compiler says:

libraries\espduino/rest.h:30:3: error: 'ESP' does not name a type ESP *esp;

It also says:

libraries\espduino/rest.h:38:12: error: expected ')' before '*' token REST(ESP *e);

I didn't make any changes in the library or what so ever. Just downloaded it, restarted arduino. Imported the library and copy+pasted the sketch.

Someone has a clue what's going on?

Thanks in advance,

Jan Paul

@walduino
Copy link

https://raw.githubusercontent.com/tuanpmt/espduino/master/espduino/examples/rest/rest.ino
builds just fine for me ;
However
I can reproduce the error when I include both MQTT.H and REST.H in one arduino sketch

@bong0
Copy link

bong0 commented Mar 19, 2016

Same issue here. @walduino do you use windows or any fs which is not case sensitive?

Using library SoftwareSerial in folder: /home/bongo/.arduino15/packages/esp8266/hardware/esp8266/2.1.0/libraries/SoftwareSerial 
Using library espduino in folder: /home/bongo/Arduino/libraries/espduino (legacy)

/home/bongo/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/home/bongo/.arduino15/packages/esp8266/hardware/esp8266/2.1.0/tools/sdk/include -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DARDUINO=10604 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266 -I/home/bongo/.arduino15/packages/esp8266/hardware/esp8266/2.1.0/cores/esp8266 -I/home/bongo/.arduino15/packages/esp8266/hardware/esp8266/2.1.0/variants/generic -I/home/bongo/.arduino15/packages/esp8266/hardware/esp8266/2.1.0/libraries/SoftwareSerial -I/home/bongo/Arduino/libraries/espduino -I/home/bongo/Arduino/libraries/disabled /tmp/build6512057098156652910.tmp/sketch_mar19a.cpp -o /tmp/build6512057098156652910.tmp/sketch_mar19a.cpp.o 
In file included from sketch_mar19a.ino:10:0:
/home/bongo/Arduino/libraries/espduino/rest.h:30:3: error: 'ESP' does not name a type
   ESP *esp;
   ^
/home/bongo/Arduino/libraries/espduino/rest.h:38:12: error: expected ')' before '*' token
   REST(ESP *e);
            ^
sketch_mar19a.ino:14:1: error: 'ESP' does not name a type
sketch_mar19a.ino:16:12: error: 'esp' was not declared in this scope
sketch_mar19a.ino: In function 'void setup()':
sketch_mar19a.ino:41:3: error: 'esp' was not declared in this scope
sketch_mar19a.ino: In function 'void loop()':
sketch_mar19a.ino:62:3: error: 'esp' was not declared in this scope
'ESP' does not name a type

I can't see any reason for this behaviour despite looking at it for hours...

@chenhy82
Copy link

I got the same error...

In file included from E:\Arduino\projects\MQTTDemo\MQTTDemo.ino:3:0:
E:\Arduino\projects\libraries\espduino/mqtt.h:18:3: error: 'ESP' does not name a type
ESP esp;
^
E:\Arduino\projects\libraries\espduino/mqtt.h:27:12: error: expected ')' before '
' token
MQTT(ESP esp);
^
MQTTDemo:7: error: 'ESP' does not name a type
ESP esp(&Serial, &debugPort, 13);
^
E:\Arduino\projects\MQTTDemo\MQTTDemo.ino: In function 'void wifiCb(uint8_t)':
MQTTDemo:13: error: 'esp' was not declared in this scope
esp.mqttConnect("mqtt.domain.io", 1880);
^
E:\Arduino\projects\MQTTDemo\MQTTDemo.ino: In function 'void mqttConnected(uint32_t
)':
MQTTDemo:19: error: 'esp' was not declared in this scope
esp.subscribe("/topic");
^
E:\Arduino\projects\MQTTDemo\MQTTDemo.ino: In function 'void mqttData(uint32_t*)':
MQTTDemo:34: error: 'mqtt_event_data_t' was not declared in this scope
mqtt_event_data_t *event_data = (mqtt_event_data_t *)args;
^
MQTTDemo:34: error: 'event_data' was not declared in this scope
mqtt_event_data_t *event_data = (mqtt_event_data_t *)args;
^
MQTTDemo:34: error: expected primary-expression before ')' token
mqtt_event_data_t *event_data = (mqtt_event_data_t *)args;
^
MQTTDemo:34: error: expected ';' before 'args'
mqtt_event_data_t *event_data = (mqtt_event_data_t *)args;
^
E:\Arduino\projects\MQTTDemo\MQTTDemo.ino: In function 'void setup()':
MQTTDemo:59: error: 'esp' was not declared in this scope
esp.wifiCb.attach(&wifiCb);
^
E:\Arduino\projects\MQTTDemo\MQTTDemo.ino: In function 'void loop()':
MQTTDemo:73: error: 'esp' was not declared in this scope
esp.process();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants