It seems there’s something slightly picky with this compiler compared to Arduino. Whenever I try to do something simple like the code below, I get an error: ‘endif’ does not name a type. The offending block is:
If I move the #include statements outside the #ifndef … #endif block, it compiles fine. Is this just a nuance in the compiler or could it be a fixable bug?
@jgoggins: Well the code compiles fine, if you just do it via with gcc from the commandline… But not when doing it from the web IDE. So I guess there is something the web IDE is doing different or even wrong.
@stevie Yeah this is probably due to our pre-processor, which does the work of taking an Arduino-like syntax and makes it a complete C++ file (with a #include and function prototypes). I’ll add this to the list of issues to look into within the pre-processor.
Guys, maybe you can make some button in web IDE to look on pre-processor modified code. With this feauture we will can debug this errors by ourselves. For now - i just can’t debug my code correctly, because compiler warns me on lines in pre-processed code, and it not exactly same as in my code…
I think that’d be very helpful! I think the pre-processor should be ignoring .h and .cpp files and it’s not doing that at the moment. If you want it to leave you alone, just add this to your file: