-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Some functions missing like strcasecmp, sprintf, dtostrf ? #70
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
Comments
have you imported stdio ? cause sprintf works fine here once stdio is imported. |
including the stdio.h fixed the sprintf |
dtostrf is an AVR specific function. Some files from the SAM core of the arduino project need to be added to the cores files See https://github.com/arduino/Arduino/search?utf8=✓&q=dtostrf Which shows which files need to be copied to the repo and how they get included I'm not sure why normal c functions are missing e.g ltoa Did you try adding your own prototype for these? |
the functions are implemented and working in the last git version. extern "C" {
#include <stddef.h>
#include <stdarg.h>
#include <stdio.h>
}
|
Can't this be added to one of the central includes e.g. Arduino.h ? |
'strtok ' was not declared in this scope strtok neither strtok_r is found even adding
I use the arduino-1.6.1-p1-windows.zip which a part this problem works well so far |
Some stuff is solved and found some workarounds for others. But still can't use this one: error: 'strcasecmp' was not declared in this scope |
you shut update to the latest git version strtok_r is implemented: |
Actually I have also used the standalone module of sandeep 0.0.3 which has the file and the modification and still strtok_r is not in scope - I will update the directory like you suggest and feedback later |
seems the function is not visible, my test skech is compiling well with a mega board but failed with ESP8266 - test1.ino: In function 'void loop()': I have did what was suggested download latest git version - I have the verified that I have the hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c with strtok_r inside =>yes
Did I missed something ? Thanks |
strtok_r is part of the string.h you need to include it. extern "C" {
#include <string.h>
} good info base is: |
do not change the result - I have tested before actually and just redid now to confirm and still even weird is strcat has no issue |
strange if i try extern "C" {
#include <stddef.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
char * b = strtok_r (NULL,".",NULL);
} it is compiling. i add all includes to the Arduino.h and also implement the "strtok" hope this helps. https://github.com/Links2004/Arduino/tree/esp8266/hardware/esp8266com/esp8266 |
Yes - I must do something wrong somewhere - I will clone the git to avoid to download the zip Thanks for your time |
I just do not get it to work with strcasecmp. Must have screwed up something somewhere... Finally decided to include the function into my sketch: int strcasecmp(const char * str1, const char * str2) { |
Using this function call:
strcasecmp
results in compiler error:
error: 'strcasecmp' was not declared in this scope
same issue for these functions:
sprintf
dtostrf
strtol
ltoa
The text was updated successfully, but these errors were encountered: