Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error C3861: 'strcasecmp': identifier not found in visual studio 2008?

im trying to port application from cygwin to visual studio 2008 express
but im getting this error :

error C3861: 'strcasecmp': identifier not found  

in this type of code:

if (!strcasecmp("A0", s))  ....

what is the replacement in vs? i can't find any thing in the net

like image 981
user63898 Avatar asked Sep 12 '10 11:09

user63898


2 Answers

add this to your precompiled header (or some other config.h)

#ifdef _MSC_VER 
//not #if defined(_WIN32) || defined(_WIN64) because we have strncasecmp in mingw
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
like image 148
Fantastory Avatar answered Nov 17 '22 20:11

Fantastory


Look for

int _stricmp(
   const char *string1,
   const char *string2 );
like image 9
Alexander Rautenberg Avatar answered Nov 17 '22 18:11

Alexander Rautenberg