TFT_eSPI.cpp报错
Please see the build logs in output path: d:\Arduino_Project\agv_remote_info_display\build
正在加载配置...
正在初始化包...
正在准备开发板...
正在验证...
In file included from D:\Program Files (x86)\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:5554:0:
D:\Program Files (x86)\Arduino\libraries\TFT_eSPI\Extensions/Button.cpp: In member function 'void TFT_eSPI_Button::drawButton(bool, String)':
D:\Program Files (x86)\Arduino\libraries\TFT_eSPI\Extensions/Button.cpp:65:25: error: 'min' was not declared in this scope
uint8_t r = min(_w, _h) / 4; // Corner radius
^
D:\Program Files (x86)\Arduino\libraries\TFT_eSPI\Extensions/Button.cpp:65:25: note: suggested alternative:
In file included from c:\users\x\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\memory:62:0,
from C:\Users\x\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/FS.h:24,
from D:\Program Files (x86)\Arduino\libraries\TFT_eSPI\Processors/TFT_eSPI_ESP8266.h:35,
from D:\Program Files (x86)\Arduino\libraries\TFT_eSPI\TFT_eSPI.h:100,
from D:\Program Files (x86)\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:16:
c:\users\x\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note: 'std::min'
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
Button.h头文件里面添加:
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
欢迎讨论,相互学习。
cdtxw@foxmail.com