If the first line of the source file has code in it, in my case
int led = 13;
then the generated c++ file is invalid:
// automatically generated by arduino-cmake
#line 1 "/home/iskren/src/arduino/input/input.ino"
int led = 13;#line 1 "autogenerated"
#include "Arduino.h"
...
And this gives the following error:
/home/iskren/src/arduino/input/input.ino:1:1: error: stray '#' in program
/home/iskren/src/arduino/input/input.ino:1:15: error: 'line' does not name a type
...
/usr/lib/gcc/avr/4.7.0/../../../../avr/include/stdlib.h:143:61: error: 'size_t' has not been declared
/usr/lib/gcc/avr/4.7.0/../../../../avr/include/stdlib.h:144:8: error: 'size_t' has not been declared
/usr/lib/gcc/avr/4.7.0/../../../../avr/include/stdlib.h:175:33: error: 'size_t' has not been declared
...
If the first line of the file is a commen (or empty), then the #line 1 "autogenerated" text is on a new line, and it works.
If the first line of the source file has code in it, in my case
then the generated c++ file is invalid:
And this gives the following error:
If the first line of the file is a commen (or empty), then the
#line 1 "autogenerated"
text is on a new line, and it works.