You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatic insertion of function prototypes fails in some cases, for example:
The file src/DCFBinaryStream.pde containing
#include<DCF77.h>//https://github.com/thijse/Arduino-Libraries/downloads
#include<Time.h>//http://www.arduino.cc/playground/Code/Time
#defineDCF_PIN2// Connection pin to DCF 77 device
#defineDCF_INTERRUPT0// Interrupt number associated with pintime_t time;
// [...]voiddigitalClockDisplay(time_t _time){
tmElements_t tm;
breakTime(_time, tm);
// [...]
}
is converted to .pioenvs/autogen_pro8MHzatmega328/src/DCFBinaryStream.cpp
#include<Arduino.h>voidsetup();
voidloop();
voiddigitalClockDisplay(time_t _time);
voidprintDigits(int digits);
#line 1 "DCFBinaryStream.pde"
#include<DCF77.h>//https://github.com/thijse/Arduino-Libraries/downloads
#include<Time.h>//http://www.arduino.cc/playground/Code/Time
#defineDCF_PIN2// Connection pin to DCF 77 device
#defineDCF_INTERRUPT0// Interrupt number associated with pintime_t time;
[...]
which leads to the compiler error
.pioenvs/autogen_pro8MHzatmega328/src/DCFBinaryStream.cpp:4:26: error: variable or field 'digitalClockDisplay' declared void
void digitalClockDisplay(time_t _time);
^
.pioenvs/autogen_pro8MHzatmega328/src/DCFBinaryStream.cpp:4:26: error: 'time_t' was not declared in this scope
DCFBinaryStream.pde: In function 'void loop()':
DCFBinaryStream.pde:39:30: error: 'digitalClockDisplay' was not declared in this scope
scons: *** [.pioenvs/autogen_pro8MHzatmega328/src/DCFBinaryStream.o] Error 1
The correct solution would be to define the prototypes at the latest possible point, most impportantly after the include directives (which however could be anywhere in the source).
Another solution would be to move the #include statements to the top, introducing the difficulty of correctly handling include statements within #ifdef/#ifndef blocks.
The text was updated successfully, but these errors were encountered:
Automatic insertion of function prototypes fails in some cases, for example:
The file src/DCFBinaryStream.pde containing
is converted to .pioenvs/autogen_pro8MHzatmega328/src/DCFBinaryStream.cpp
which leads to the compiler error
The correct solution would be to define the prototypes at the latest possible point, most impportantly after the include directives (which however could be anywhere in the source).
Another solution would be to move the
#include
statements to the top, introducing the difficulty of correctly handling include statements within#ifdef
/#ifndef
blocks.The text was updated successfully, but these errors were encountered: