Open ryanneve opened 7 years ago
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,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,
from sketch\Json_Serial.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:90:18: error: overriding 'virtual void Print::flush()'
virtual void flush() { /* Empty implementation for backward compatibility */ }
^
exit status 1 conflicting return type specified for 'virtual int aJsonStream::flush()'
在文件 -> 首选项开启 “编译过程中显示详细输出”选项 这份报告会包含更多信息。
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.