I keep forgetting how horrible it is to code in C/C++ between my arduino projects.
-
I keep forgetting how horrible it is to code in C/C++ between my arduino projects. Here is a story from yesterday, debugging a very peculiar error from the compiler:
Error: 'fs' was not declared in this scope; did you mean 'fs::FS'?
This was from a very popular library, so it's weird that I got this error. Googled AI suggested I declare the namespace at the top of the file, but that felt wrong. Why wasn't anyone else getting this error?
-
I keep forgetting how horrible it is to code in C/C++ between my arduino projects. Here is a story from yesterday, debugging a very peculiar error from the compiler:
Error: 'fs' was not declared in this scope; did you mean 'fs::FS'?
This was from a very popular library, so it's weird that I got this error. Googled AI suggested I declare the namespace at the top of the file, but that felt wrong. Why wasn't anyone else getting this error?
A bit more Googling gave me a forum post with the solution: swap the order of these two imports:
#include <TFT_eSPI.h>
#include <WifiManager.h>They both rely on the same #define so the wrong order makes the second one do something wrong.
Global definitions where multiple libraries can decide to use the same name is such wonderful fun...
-
I keep forgetting how horrible it is to code in C/C++ between my arduino projects. Here is a story from yesterday, debugging a very peculiar error from the compiler:
Error: 'fs' was not declared in this scope; did you mean 'fs::FS'?
This was from a very popular library, so it's weird that I got this error. Googled AI suggested I declare the namespace at the top of the file, but that felt wrong. Why wasn't anyone else getting this error?
@gundersen oh Arduino code is horrid, and hey, dont blame C its flat and doesn't take much effort to find anything.
-
R relay@relay.infosec.exchange shared this topic