Hi ,
I created a new App, named it Test, opened the Webserver library, clicked on the Web_AjaxRGB_mobile.ino example and then clicked on “Include in App”, and included it in the newly created Test App.
This added the following line in my App -
// This #include statement was automatically added by the Spark IDE.
#include "WebServer/WebServer.h"
I just had empty setup() and loop() functions in this file.
I clicked Verify, got a message "Great Work"
I clicked on Flash, got following error -
In file included from ../wiring/inc/spark_wiring.h:47:0,
from ./inc/application.h:29,
from /spark/compile_service/shared/workspace/6_hal_12_0/firmware-privatest.cpp:2:
../wiring/inc/spark_wiring_ticks.h:32:22: error: previous declaration of 'system_tick_t millis()' with 'C++' linkage
inline system_tick_t millis(void) { return HAL_Timer_Get_Milli_Seconds(); }
^
In file included from /spark/compile_service/shared/workspace/6_hal_12_0/firmware-privatest.cpp:2:0:
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaWebServer/WebServer.h:150:37: error: conflicts with new declaration with 'C' linkage
extern "C" unsigned long millis(void);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaWebServer/WebServer.h: In member function 'bool WebServer::readPOSTparam(char*, int, char*, int)':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaWebServer/WebServer.h:1044:39: warning: narrowing conversion of 'ch1' from 'int' to 'char' inside { } [-Wnarrowing]
char hex[3] = { ch1, ch2, '\x0' };
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaWebServer/WebServer.h:1044:39: warning: narrowing conversion of 'ch2' from 'int' to 'char' inside { } [-Wnarrowing]
make[1]: *** [../build/target/user/platform-6test.o] Error 1
make: *** [user] Error 2
Flash unsuccessful.
The I copy - pasted the sketch from the Web_AjaxRGB_mobile.ino file (removed the #include from the original and kept the new #include statement), and compiled, It compiled successfully, but flashing gave me the exact same error as above.
I then removed the included Webserver library from the project, added a new header file “Webserver.h” and copy-pasted the code from Webserver.h in this file.
This also compiled fine, but game me the same error when flashing the code.
Please help for flashing
Thanks in advance
Update:
I tried to include other libraries, they all are giving similar issues while flashing, but no issues while compiling.
I wrote my own simple sketch to turn on/off LEDs from my phone app, and am able to flash that and it works great.
Looks like the flashing issue is only when I include some library or try to use a library
Hope someone can help me resolve this soon as I want to test and use the Webserver example