declaration of functions depends of Arduino software version


I have a huge arduino sketch with hundreds of functions. It runs fine sob Arduino software version 1.0.x.

After installing version 1.6.x (I tried x = 7 and 9), my sketch produces a lot of error of the type: 'funcion' was not declared in this scope.

ok, my functions generally are NOT forward declared because version 1.0.x did not required this.

I know, that
+++ or rearranging the sequence of the function
+++ or declaring them before the programmimg code
can fix this. But I don't want to do this.

Is there another way to fix this? Is software version 1.0.x the better one?


Why are you against forward declarations. Apparently the IDE quit putting them in for you. So you have two options, put them in yourself, or go back to a version that put them in for you.

With version 1.0.x I had a problem, too (see here). I resolved this by actualizing the software. But, I got the actual problem :frowning:

Declare a function before define it seems me very "20th century" (yes, this is the compatibility to C++ and not to C#). Is there really no way for, for example, double routing the C-(pre-)processor or another way?

And: why version 1.0.x was not C++ compatible?



Are all your source files .ino and not .cpp? I think that will tell the IDE to merge the files into one sketch and give them all the special Arduino treatment.

John, thank you for answering.

Yes, all .ino-files!

What do you mean: .ino's ou .cpp's will make it work?



it is crazy: I write a simple sketch (in one or in two .ino-files) in Arduino 1.6.9 where i call a function in the setup() and declare (& define) that function AFTER the setup() - it works and does not need any forward declaration! (?!?!)

With my "old" huge copied sketch this does not work! (?!?!)

Yes, all .ino-files!

Then I would have expected it to work.

John and others,

problem "solved", but not explained - see here (need of a blank line in sketch? - Programming Questions - Arduino Forum).

Thank you