OpenSprinkler › Forums › OpenSprinkler Unified Firmware › OSPi 2.1.9 build errors › Reply To: OSPi 2.1.9 build errors
October 18, 2019 at 12:03 am
#62972
Marc
Participant
I just updated my Raspberry Pi installation (after running a “git pull” from my installation directory), and thought I should mention that I ran into the same problem:
pi@sprinkler:~/OpenSprinklerGen2 $ sudo ./build.sh ospi
Building OpenSprinkler...
weather.cpp: In function 'void getweather_callback(char*)':
weather.cpp:55:31: error: 'atoi' was not declared in this scope
wt_errCode = atoi(tmp_buffer);
^
weather.cpp:61:22: error: 'atoi' was not declared in this scope
v = atoi(tmp_buffer);
^
weather.cpp:71:22: error: 'atoi' was not declared in this scope
v = atoi(tmp_buffer);
^
weather.cpp:80:22: error: 'atoi' was not declared in this scope
v = atoi(tmp_buffer);
^
weather.cpp:89:31: error: 'atol' was not declared in this scope
uint32_t l = atol(tmp_buffer);
^
weather.cpp:98:22: error: 'atoi' was not declared in this scope
v = atoi(tmp_buffer);
^
weather.cpp:110:22: error: 'atoi' was not declared in this scope
v = atoi(tmp_buffer);
^
Done!
I added a line to the weather.cpp file to include the C standard library include file (i.e., “#include <stdlib.h>”), and that appears to have resolved the issue for me:
pi@sprinkler:~/OpenSprinklerGen2 $ sudo ./build.sh ospi
Building OpenSprinkler...
Done!