SD Card not found

Hi

When I try to compile the ''TFTDisplayText.ino'' example file in the TFT Library I get the following message.

The SD library was not found.

This sketch does not even use a SD Card so why the warning message.

The fail to upload is not the problem ,that was the only way I could create a error messge to be able to

copy the verbose output to the forum.

Below is the verbose message.

Thanks for helping.

Arduino: 1.8.9 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mike\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -ide-version=10809 -build-path C:\Users\mike\AppData\Local\Temp\arduino_build_45452 -warnings=default -build-cache C:\Users\mike\AppData\Local\Temp\arduino_cache_635440 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\libraries\TFT\examples\Arduino\TFTDisplayText\TFTDisplayText.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\mike\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328old -ide-version=10809 -build-path C:\Users\mike\AppData\Local\Temp\arduino_build_45452 -warnings=default -build-cache C:\Users\mike\AppData\Local\Temp\arduino_cache_635440 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Program Files (x86)\Arduino\libraries\TFT\examples\Arduino\TFTDisplayText\TFTDisplayText.ino
Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\sketch\\TFTDisplayText.ino.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\libraries\\TFT\\src" "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\sketch\\TFTDisplayText.ino.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\libraries\\TFT\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\sketch\\TFTDisplayText.ino.cpp" -o nul
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\libraries\TFT\src\TFT.cpp
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\libraries\TFT\src\utility\Adafruit_GFX.cpp
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\libraries\TFT\src\utility\Adafruit_ST7735.cpp
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\libraries\TFT\src\utility\glcdfont.c
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src\SPI.cpp
Generating function prototypes...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\libraries\\TFT\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\sketch\\TFTDisplayText.ino.cpp" -o "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Program Files (x86)\\Arduino\\libraries\\TFT\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\sketch\\TFTDisplayText.ino.cpp" -o "C:\\Users\\mike\\AppData\\Local\\Temp\\arduino_build_45452\\sketch\\TFTDisplayText.ino.cpp.o"
In file included from C:\Program Files (x86)\Arduino\libraries\TFT\src/TFT.h:36:0,

                 from C:\Program Files (x86)\Arduino\libraries\TFT\examples\Arduino\TFTDisplayText\TFTDisplayText.ino:18:

C:\Program Files (x86)\Arduino\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."

   ^

Have you loaded the SD card library? You haven't posted the code so am not sure which exact library you need.

This sketch does not even use a SD Card so why the warning message.

The sketch in question is also on your pc.

Program files(x86)/Arduino/Libraries/TFT/Examples/Arduino/''TFTDisplayText.ino''

Don't worry about it, it's just a warning.

I don't have that example, but from the message it seems to be saying that the Adafruit library has functions that can load images from an SD card but it relies on the SD library to do so. Since you're not using those functions, it's just warning you (a little pointlessly) that you couldn't even if you wanted to.

This sketch does not even use a SD Card so why the warning message.

Your sketch may not use the SD library but from the warning message (NOTE : it is not an error message) it looks like there are two TFT library functions that do require the SD library to be present

 #warning "The SD library was not found. loadImage() and image() won't be supported."

The two functions are present in the Adafruit_GFX library which the TFT library is a wrapper for. A comment in that library says the following

* This library can work with or without the presence of an SD
 * reading library (to load images). At the moment, only the
 * Arduino SD library is supported; it is included in
 * standard Arduino libraries.

Thanks widbill.

I did manage to upload the Cardinfo.ino sketch that is also a sample file in the Arduino SD Library and it works fine,reads the SD Card and display the info in the serial monitor.

Thanks UKHeliBob.

My previous post was done before reading your post.

Even if I include SD.h I get the same message,but the Cardinfo.ino sample found in the SD Library works fine, no warnings....confusing?

For me :confused:

Thanks UKHeliBob.

My previous post was done before reading your post.

Even if I include SD.h I get the same message,but the Cardinfo.ino sample found in the SD Library works fine no

warnings....confusing?

For me

mikedb:
Thanks UKHeliBob.

My previous post was done before reading your post.

Even if I include SD.h I get the same message,but the Cardinfo.ino sample found in the SD Library works fine no

warnings....confusing?

For me

Here are the pertinent lines from the Adafruit_GFX.h file

#if defined(__SD_H__)  // Arduino SD library
 #include "PImage.h"
#else
 #warning "The SD library was not found. loadImage() and image() won't be supported."
#endif

The SD.h file has the usual guard in it against being loaded twice, ie

#ifndef __SD_H__
#define __SD_H__

As the SD.h file is not used in the program that you are testing then SD.H is not set and you get the warning message

Thanks UKHeliBob.