-
Notifications
You must be signed in to change notification settings - Fork 136
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
int flush() in aJsonStream overrides void flush() in Print #89
Comments
Same problem here, can't compile using latest IDE and ESP8266 latest version too. Same error. |
same to me here. I commented out the corresponding flush method (in cpp and in h) to make my build work again. |
FWIW, I created a patch for this. I also checked the aJson code and no one is calling flush so it shouldn't hurt the library. Any application code checking the return code of flush might be affected but it's an easy fix - don't check the return code (it doesn't tell you anything useful anyway). Patch can be found here: https://gitlab.com/xarduino/lightsw/blob/master/patch/ajson-void-flush.patch |
Arduino:1.8.5 (Windows 10), 开发板:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)" In file included from D:\360瀹夊叏娴忚鍣ㄤ笅杞絓aJson-master (1)\aJson-master\Examples\Json_Serial\Json_Serial.ino:19:0: aJSON.h:92: error: conflicting return type specified for 'virtual int aJsonStream::flush()' int flush();
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:90:18: error: overriding 'virtual void Print::flush()'
exit status 1 在文件 -> 首选项开启 |
It looks like aJsonStream.flush() returns an int, but is trying to override Print.flush() which returns void.
I'm getting compile errors with arduino 1.8.3:
Changing aJsonStream.flush() so it doesn't return anything fixes the problem, but not sure if it might create other problems.
The text was updated successfully, but these errors were encountered: