'Serial' was not declared in this gcc


#1

Hi…I’m want to read and write data to SD card. So I tried using SD-CARD-LIBRARY, but I got the error in sd2-card-config.h saying that Serial was not declared.
How to solve this issue?


#2

Do you have #include “Particle.h” in your .ino?
Also, which version of the library are you using and have you built it before on another Device OS?
I use SdFat library.


#3

I suggest you use SdFat library instead.

It’s no surprise that defining a macro that in fact referes to itself isn’t going to work :wink:

#define Serial Serial

That’s what one migh call a circular reference.