X was not declared in this scope - but i think it IS.

I try compiling a project that did work before, but now it does not.
I get errors about roughly everything...
It looks to me like the header file is not "found/read" for compiling. But it IS automatically loaded in the IDE (1.8.9)

In my Project.ino file a header file is included, which contains the definition of constants that the compiler complains about.

in header file:
#define CP_CHECK_SMS 1200

compile error:

RiverSMS:5:10: error: 'CP_CHECK_SMS' was not declared in this scope

If i rename the header file, i get an error about it not existing.
And if i add some trash lines to the top of the header file, which i expect would throw an error, it does so:

1 #delfin sometrash
2 #define XYZ

error: invalid preprocessing directive #delfin

So i guess i miss something basic... Any hints?

Yes, here's a hint. Post your code and post the actual error messages. Then it might be possible to help.


You are not understanding what #define is and what it does.
#define is a preprocessor directive, it is used before the code is compiled.

In your case you are creating an identifier CP_CHECK_SMS that will be replaced with 1200 before compilation takes place.

You have not supplied your code but I am guessing that you have also used CP_CHECK_SMS as a variable which has not been replaced before compilation and, since the variable has not been declared, the compiler throws an error.

Thanks guys.
Yes, i do not fully grep what the preprocessor does and am in over my head for sure.
I was just trying to get confirmation that the file is read, make the compile (or preprocess) steps throw an error. I feel i succeeded there.

The problem was the project's directory name containing capital letters where the sketch was all lower case.