Open karlosss opened 8 years ago
It's not clear from reading @karlosss issue report but this warning does still appear even if you include SD.h before including TFT.h. Here is the minimal demonstration code:
#include <SD.h>
#include <TFT.h>
void setup() {}
void loop() {}
And the warnings from Arduino IDE 1.8.3:
In file included from E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\TFT.h:36:0,
from E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\TFT.cpp:32:
E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\utility/Adafruit_GFX.h:60:3: warning: #warning "The SD library was not found. loadImage() and image() won't be supported." [-Wcpp]
#warning "The SD library was not found. loadImage() and image() won't be supported."
^
In file included from E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\utility\Adafruit_GFX.cpp:34:0:
E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\utility\Adafruit_GFX.h:60:3: warning: #warning "The SD library was not found. loadImage() and image() won't be supported." [-Wcpp]
#warning "The SD library was not found. loadImage() and image() won't be supported."
^
In file included from E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\utility\Adafruit_ST7735.h:28:0,
from E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\utility\Adafruit_ST7735.cpp:19:
E:\ArduinoIDE\arduino-1.8.3\libraries\TFT\src\utility\Adafruit_GFX.h:60:3: warning: #warning "The SD library was not found. loadImage() and image() won't be supported." [-Wcpp]
#warning "The SD library was not found. loadImage() and image() won't be supported."
The problem is that the warning is triggered if the SD library include guard macro __SD_H__
is not defined. It is defined during the include from the sketch since it previously included SD.h but the macro is not defined when Adafruit_GFX.h is also included from the separate translation units of Adafruit_GFX.cpp and Adafruit_ST7735.cpp.
Hello, @per1234 any solutions about this?
When I run the following code snippet, i get this warning. Should I be afraid of it if I want to use images in the future? Nothing changes when I include
<SD.h>
.