I have a 3.2 inch tft lcd and i use the TFT_HX8357 library since that was the only one i got working with this display.
Now i want to load a BMP file from the included SD card slot.
There is a example included with the library but i cant get it to compile
All the other examples are working fine exept that one.
When i try to compile i get a error
This is what it says: Draw_SDCard_Bitmap:16: error: 'File' was not declared in this scope
Now i have been tinkering about this for way to long and i still got no solution.
So i am asking for help
I've have downloaded a new copy of the GitHub library and loaded it in a virgin copy of the latest IDE (1.8.0) and it compiles fine. I also tested it with IDE version 1.6.12 and IDE 1.6.7 and it is OK. I also took the copies of the sketch you provided in the post (in case they have been altered!) and they compile fine too.
"File" is a variable "type" defined in the stock SD library that comes with the IDE. So it looks like you have a bad copy of the SD library or perhaps are using an old IDE that has problems.
I suggest you try loading a new copy of the Arduino IDE (I manually load it so I can have multiple copies of the IDE to test my libraries with). Also make sure you don't have a rogue copy of the SD library in your "sketches" library folder, so the IDE uses it's built in copy.
If this fixes it (or not) then post back your findings.
I've been looking at the SD library header file and right at the end it says:
// This allows sketches to use SDLib::File with other libraries (in the
// sketch you must use SDFile instead of File to disambiguate)
typedef SDLib::File SDFile;
typedef SDLib::SDClass SDFileSystemClass;
#define SDFileSystem SDLib::SD
So you could try changing the "File" type to "SDFile " in all places in the "bitmap_functions" sketch:
Line 19: SDFile rawSDFile;
Line 75: SDFile bmpSDFile;
Yet another option to try is to install the SdFat library and adapt the sketch by commenting out line 15 and uncommenting lines 18 and 19 in the Draw_SDCard_Bitmap sketch.
Thanks! it works now!
You were right about that there was a chance that i got a bad library.
I Updated the Arduino IDE and it works fine now (i was still running version 1.6.2, too lazy to update and afraid that sketches and library's wouldn't work anymore )
So again thanks bodmer!