Closed joshpfosi closed 9 years ago
I think the problem is that ino copies the behaviour of the Arduino IDE and inserts function prototypes at the top. This won't work if the functions use a type declared in the sketch. I think the solution is to define the enum in a header file and include that at the top. Hopefully the prototypes are inserted below the headers.
BTW in C++ states becomes a first class type, so you don't need the enum keyword before its uses.
Worked great, thank you!
Hi, new to
ino
here but grateful for it! Unfortunately, it seems to be introducing a compiler error in my sketch (below). I've attached the whole sketch for reproduction purposes. I simply have a new ino project with this as the only src file (sketch.ino
). When I runino build
, it producessketch.cpp
(attached below) which has a clear error due to prepending function declarations to the top of the file. I ran it throughcpp
and this is not default behavior (obviously, but to be sure), so not sure if this is a bug withino
or my use of it! Please help, I really would like to use anenum
in this way to clean things up.By the way, running w/ Arduino Mega 2560, on Mac OS Yosemite. I've tried removing
.build
and rebuilding but same error.Thanks!
Ino Build Error: