marcoschwartz / aREST

A RESTful environment for Arduino
http://aREST.io/
Other
1.2k stars 279 forks source link

aRest.h compilation error #268

Closed ai04yc01 closed 3 years ago

ai04yc01 commented 5 years ago

This library is great. But when I tried to compile it with Firebase client (#include "FirebaseESP8266.h"), a bunch of errors occurred.

In file included from C:\Users\User\Documents\Arduino\arduino-wifi-firebase-lightstrip\arduino-wifi-firebase-lightstrip.ino:38:0:

C:\Users\User\Documents\Arduino\libraries\aREST/aREST.h: In member function 'void aREST::send_http_headers()':

C:\Users\User\Documents\Arduino\libraries\aREST/aREST.h:453:190: error: no matching function for call to 'aREST::addToBufferF(const char [158])'.....

As FirebaseESP8266.h must be followed by ESP8266WiFi.h, moving the position of aREST.h anywhere before, in-between and after the 2 libraries will yield mixed error messages.

Any insights on how to fix?

LucasGuitton commented 4 years ago

I got the same issue on custom ino with aREST.h included and with my Adruino UNO Wifi REV2. If I found something, I'll tell you

gcuendet commented 4 years ago

I got the same issue on my Arduino UNO Wifi REV2 and found a related discussion here pointing to another discussion linking to a "bug" in ArduinoCore-megaavr.

Apparently just defining __FlashStringHelper solves the problem:

#define __FlashStringHelper char

I added that just before including aRest.h, not sure if that's the best way, but it works.