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

﹥>﹥吖頭↗ 提交于 2019-12-20 18:31:30

问题


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


回答1:


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



回答2:


Look for

int _stricmp(
   const char *string1,
   const char *string2 );


来源:https://stackoverflow.com/questions/3694723/error-c3861-strcasecmp-identifier-not-found-in-visual-studio-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!