Strange compiler behaviour

Arduino IDE 2.3.2. Windows 10.

When I compile this code:

// xxx
// yyy
// zzz

#include <TinyGPSPlus.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal_I2C.h>
#include <time.h>

void setup() {
}

void loop() {
}

I get the error message:
fatal error: TinyGPSPlus.h: No such file or directory


If I delete one of the leading comment lines, for example
// xxx

the compilation is succesful.


If I delete one more comment line, I again get an error:
fatal error: SoftwareSerial.h: No such file or directory

This time it is SoftwareSerial.h that is "not existent".


If I delete the last comment line, I again get an error:
fatal error: LiquidCrystal_I2C.h: No such file or directory

This time it is LiquidCrystal_I2C.h that is "not existent".


If I delete the leading, blank line
the compilation is succesful.


  1. I used comment lines here for clarity. It could be empty lines as well.

  2. It is not consistent which file is pointed out as non-existent. Or I am not aware if there is a any systematics.

  3. I made NO changes other than deleting the mentioned lines between each compilation.

  4. if I rewrite the deleted lines, I get the errors back.

  5. The included files ARE installed and work in other sketches. (And the compiler accepts the inclusions in the successful examples above.)


How can blank lines / comment lines affect the compilation at all?

Yes. In a way, it can be compared to deleting all leading comment lines / blank lines.

I made a short video to better show the phenomenon.

It would be nice if this bug could be fixed. I spent a lot of time trying to figure out why it wouldn't find my inclusions until I discovered the effect of leading blank lines.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.