Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling sketch (strtok_r) #86

Closed
marcoschwartz opened this issue Apr 19, 2015 · 10 comments
Closed

Error when compiling sketch (strtok_r) #86

marcoschwartz opened this issue Apr 19, 2015 · 10 comments

Comments

@marcoschwartz
Copy link

Hello,

Since the last commit (ec4f53e) 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

@Links2004
Copy link
Collaborator

can you test the fix above?

@marcoschwartz
Copy link
Author

I just tried the fix, same error.

@Links2004
Copy link
Collaborator

can you provide an example, I don't get the error reproduced.

@marcoschwartz
Copy link
Author

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

@Links2004
Copy link
Collaborator

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?

@gregslomin
Copy link

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.

#89

@valeros
Copy link
Contributor

valeros commented Apr 20, 2015

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);

@jeffryr
Copy link

jeffryr commented Apr 20, 2015

I also have the same error as marcoschwartz after doing a clean build. The gregslomin fix works for me.

@marcoschwartz
Copy link
Author

Just tried again with my aREST library + the gregslomin fix, now it works for me as well.

@igrr
Copy link
Member

igrr commented Apr 21, 2015

merged the fix in 2edc522, thanks!

@igrr igrr closed this as completed Apr 21, 2015
igrr added a commit that referenced this issue Apr 26, 2015
* esp8266: (21 commits)
  HardwareSerial: add other configs than 8N1
  Delete jre-8u31.zip.sha
  Fix Windows build
  Add boot loader compatible speed of 74880 to serial.
  update SDK to esp_iot_sdk_v1.0.1_15_04_24
  include stdlib_noniso.h in Arduino.h see #110
  strnlen implementation
  missing strn program space wrappers
  uart_interrupt_handler is now in ram
  move libm to flash (.irom0.text) saves 3544 Byte in ram see #104
  Revert c_types.h
  fix bug #98
  add INPUT_PULLDOWN support
  add prototypes for ets_vsnprintf and ets_vprintf fix some compiler warnings
  update SDK to 1.0.1_b2_15_04_10 + SSL Patch
  update SDK to 1.0.1_b1_15_04_02
  add files to ignore (use hardlink) to get git hardware in arduino dir
  Add method to configure softAP IP address
  test for #86
  add to ESP class: getChipId getSDKversion getBootVersion getBootMode getCPUfreqMHz
  ...
igrr pushed a commit that referenced this issue Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants