tuanpmt / espduino

ESP8266 network client (mqtt, restful) for Arduino
http://tuanpm.net/post/espduino
MIT License
382 stars 122 forks source link

Using both REST and MQTT results in error #45

Open walduino opened 8 years ago

walduino commented 8 years ago

I've been using Tuan's lib with mqtt for a while now with great succes (thanks !!), but now I want to download setting via REST before i setup the mqtt part. When I try to use them both by including both:

#include <mqtt.h> 
#include <rest.h>

and using:

MQTT mqtt(&esp);
REST rest(&esp);

in my code i get build errors (the error differs depending on the order i include them so i'm guessing this is a lib code bug)

code @ https://github.com/walduino/Cheapspark/commit/721d1425a7112aa3f7ae738404e28b46f13a2132

walduino commented 8 years ago
#include <espduino.h>
#include <mqtt.h>
#include <rest.h>

ESP esp(&Serial, 4);
MQTT mqtt(&esp);
REST rest(&esp);

main.ino:9:1: error: 'REST' does not name a type

#include <espduino.h>
#include <rest.h>
#include <mqtt.h>

ESP esp(&Serial, 4);
MQTT mqtt(&esp);
REST rest(&esp);

main.ino:9:10: error: variable 'MQTT mqtt' has initializer but incomplete type