Go Down

Topic: DUE - Problem showed up (I am sure it is my error) finding stricmp library (Read 760 times) previous topic - next topic


Code is below after comments on the problem (very simple program);
1) 1.5.2 started reporting problem in the middle of today where it had worked previously
2) Tried simple program with and without the includes
3) Reinstalled 1.5.2, problem persisted
4) Downloaded and installed 1.5.4r2, problem persisted
5) I suspected the the compiler is not looking in the correct directory that contains the string.h file the stricmp is suppose to be a member of.

Any clues? suggestions?

Thanks in advance.

#include <Arduino.h>
#include <string.h>
void setup() {
bool doOnce = true;

void loop() {
  if (doOnce) {
    if (stricmp("ABC","DEF") < ) {
      Serial.println("Less than");

sketch_sep11a.ino: In function 'void loop()':
sketch_sep11a:11: error: 'stricmp' was not declared in this scope
sketch_sep11a:11: error: expected primary-expression before ')' token


   if (stricmp("ABC","DEF") < 0) {

under copied to code to paste

This still does not work


You are including string.h for no reason, but that's not the problem. Sorry, lower case 's' is indeed what you need I think. Also instead of all the doOnce stuff just put the code in setup().

Maybe stricmp() is not part of the standard libraries.


   if (strcasecmp("ABC","DEF") < 0) {

that compiles but stricmp is defined to that anyway in string.h

Rob Gray aka the GRAYnomad www.robgray.com


Thanks for your reply.
However, the problem was actually very simple after I sleep on the problem.
I some how in all my trackball moving and clicking got the board type changed from DUE to another board.
FYI, the stricmp is part of the standard library with DUE.
Using the correct board type, the program compiles perfectly without any includes at all.
The reason I use the doOnce variable is to stop messages going to the SerialMonitor.
Very handy to use during testing.
Thanks again for at least give the problem some thought.
Drop me an email, always interested in exchanging ideas with our down under buddies.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131