stray '##' in program compiler error

Hi all,

Working on a Due' board. Arduino IDE 1.8.12

I retrieved an old project (5 years or so since it was last updated/used) from my git repository. I plugged in an older Due' board, about the same vintage. I opened the *.ino file, opening the IDE I clicked the 'verify' check mark to compile the project (no changes, just checking that it still worked).

I got the stray '##' error right off the bat, not a successful compile.

sketch\Adafruit_ADS1015.cpp.cpp:1:1: error: stray '##' in program

line 68 "C:\Sandbox\OrigFile\OrigFile.ino"


The indicated line of code is the first line of actual code in the *.ino file (not the comments, #defines or #includes). I searched through the include files, no joy. I deleted and retyped the indicated line, and the lines before and after, no joy. I tried some other things, but they didn't work.

So, I decided to come to the forum. To describe my problem, I decided to throw out everything that wasn't the problem so I could post a short project that showed the problem.

Since I didn't want to trash my historical project, I copied the folder to a new name (Mini_Sample) I renamed the *.ino file to Mini_Sample.ino I renamed the 'project header file' to Mini_Sample.h (and updated the #include).

Now I was ready to start stripping stuff out! Before I removed anything I clicked the Verify check mark, and it COMPILED!

I just copied the folder, and renamed the *.ino and *.h, and the problem went away!

I'd like to go back to my original folder and file name, to maintain the consistency in the git repository.

Anyone have any thoughts as to what might be the original problem?

Thanks for reading to the end. And thank you for any ideas.

Can you provide a pointer to your git repository that contains the failing code?


That's a weird filename to have generated... One thing I've noticed is that if I used an external editor, sometimes I'll get an autosave file named something like #Blink.cpp, and the IDE will say "ah hah! It's a cpp file! I shall compiled it!" You may have something similar happening with the git "invisible" files...