I installed library Adafruit_GFX
and Adafruit SSD1306.
I used the example from: ..MyDocuments\Arduino\libraries\Adafruit_SSD1306\examples\ssd1306_128x64_i2c
It builds and loads fine. No issue.
I then copied the code from this example into my own newly created project.
I then get this error:
fatal error: Wire.h: No such file or directory.
But it appears that all my #includes are a problem, They look like this:
The output with the #line that you posted seems to be the output of the Arduino builder. Your ino file would usually not contain that line and most people also don't include the Arduino.h file.
I seem to remember that I have experienced problems when including Arduino.h in the ino file; I know it's not needed because the builder will include it for you.
This time, instead of starting a new project and pasting example code into it, I opened the example and then used 'save as' to make it mine.
Then I pasted my original code into this and it is building fine as far as the header files go.
The arduino.h was automatically added from somewhere.
The #line was originally not there but appeared at some stage after re-opening the IDE and project. I still have no idea what it means and I discovered more of those #line directives in other places of my code.
Ohhhh wait....
I just remembered:
My code was all lost because IDE 2.1.? never saved anything. It pretended to but did not. I lost a big chunk of work.
So I managed to recover all of it from some Arduino build folder as a .cpp file.
The #line stuff may have come from there,
Hmm.