Error when compiling sketch (strtok_r)
Hello,
Since the last commit (ec4f53e70508018a1ec644333f4a8045db7eb29f) I have an error with a sketch that was working before:
/Users/marco/Downloads/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c: At top level: /Users/marco/Downloads/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c:166:25: error: conflicting types for 'strtok_r' char* ICACHE_FLASH_ATTR strtok_r(char * str, const char * delimiters, char ** temp) { ^ /Users/marco/Downloads/Arduino/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c:163:12: note: previous implicit declaration of 'strtok_r' was here return strtok_r(str, delimiters, NULL); ^ Error compiling.
Any idea about this issue? Thanks
can you test the fix above?
I just tried the fix, same error.
can you provide an example, I don't get the error reproduced.
I get the error with my aREST library that implements a REST interface for the chip. You can find the example here:
https://github.com/marcoschwartz/aREST/tree/master/examples/ESP8266
is working fine. only one error
../ESP8266_aREST.ino:42:23: error: 'ledControl' was not declared in this scope
rest.function("led",ledControl);
i command it out and than it compile.
i only wondering why the implementation is in the .h file and there is no .cpp file for the library?
After pulling the latest, running ant clean and ant dist I get the same error on the mDNS example sketch.
See if this pull request fixes it for you, it did for me.
https://github.com/esp8266/Arduino/pull/89
I have the same error as marcoschwartz: .pioenvs\esp01_8266\FrameworkArduino\libc_replacements.c: In function 'strtok': .pioenvs\esp01_8266\FrameworkArduino\libc_replacements.c:164:5: warning: return makes pointer from integer without a cast [enabled by default] return strtok_r(str, delimiters, NULL); ^ .pioenvs\esp01_8266\FrameworkArduino\libc_replacements.c: At top level: .pioenvs\esp01_8266\FrameworkArduino\libc_replacements.c:167:25: error: conflicting types for 'strtok_r' char* ICACHE_FLASH_ATTR strtok_r(char * str, const char * delimiters, char ** temp) { ^ .pioenvs\esp01_8266\FrameworkArduino\libc_replacements.c:164:12: note: previous implicit declaration of 'strtok_r' was here return strtok_r(str, delimiters, NULL);
I also have the same error as marcoschwartz after doing a clean build. The gregslomin fix works for me.
Just tried again with my aREST library + the gregslomin fix, now it works for me as well.
merged the fix in 2edc522, thanks!