m5stack / M5GFX

Graphics library for M5Stack series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: cannot declare variable 'file' to be of abstract type 'lgfx::v1::DataWrapperT<fs::SDFS>'

chillymattster opened this issue · comments

Hi,
I'm quite new to M5Stack and own a CoreS3. Trying to compile with VS Code and Platformio, I get an error exactly as described here: M5Stack Community: Cardputer and drawJpgFile

It looks like being related to issue #72 Question: drawPngFile using SdFat

Are there any ideas on how to solve this?
Any help is greatly appreciated!

Hello, @chillymattster

If you want to use a set of functions to handle SD/SPIFFS/HTTP,
please include <SD.h>,<SPIFFS.h>,<HTTPClient.h> before <M5GFX.h>

#include <SD.h>  // before M5GFX isOK.
#include <M5GFX.h>
#include <M5GFX.h>
#include <SD.h>  // after M5GFX. is NG

Hi @lovyan03,

that's an amazingly fast and very helpful answer, many thanks, very much appreciated! 😄

I'm not directly referencing <M5GFX.h> but <M5CoreS3.h> so for me the solution is

#include <SD.h>  
#include <M5CoreS3.h>