-
Notifications
You must be signed in to change notification settings - Fork 13.3k
sketch cannot find strncpy_P because of header conflict #343
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
In PgmSpace.cpp it already contains strncpy_P() so there should be no need for you to add it. There is something else wrong. |
here the test sketch :
and compilation error:
I am using the boardmanager version of ESP8266 package |
There seems to be header/path conflict. If you remove the include for Arduino.h it will compile. there should be no need to include prgmspace.h as arduino.h already does this for you. |
actually before I did not use I did not tried change header position - just did now and yes it solve the problem But is that a normal behaviour ? |
I guess not as if I use only |
I changed issue title to better match problem |
The issue is that extern "C" is incorrectly being applied inside Arduino.h to things that don't need it; in this case specifically the include for pgmspace.h as it is not a legacy "C" header file. |
fixed Links2004@936669e |
Thanks a lot ^_^ |
FYI, downloaded and installed the EtherCard library from GitHub, and loaded up one of the sample app (SSDP). When using Arduino IDE version 1.6.5 with Arduino Due board, compilation fails with the same "...strncpy_P..." error. Changing the order of the include files (suggested above) did not fix the problem. So switched to other boards like Leonardo, Uno, Ethernet etc, and the compilation was successful without any errors. So I guess the error has something to do with board specific declarations, for the Due board or could be specific to this version of the Arduino IDE. I hope this helps someone having a similar issue. |
Hi I store my strings using PROGMEM to save some memory :
const char mystring[] PROGMEM = "my string!";
but when I want to access it to use it using strcpy_P
I have compilation error about missing strncpy_P
So I have added manually in my project :
and all is working.
But is that normal strncpy_P is missing ? or is there another way to read strings stored by PROGMEM?
If it is missing, is there any plan to add it ?
I have checked open/closed issues but nothing pop up sorry
Thanks
The text was updated successfully, but these errors were encountered: