【问题标题】:error C3861: 'strcasecmp': identifier not found in visual studio 2008?错误 C3861:“strcasecmp”:在 Visual Studio 2008 中找不到标识符?
【发布时间】:2011-04-11 07:38:15
【问题描述】:

我正在尝试将应用程序从 cygwin 移植到 Visual Studio 2008 Express
但我收到此错误:

error C3861: 'strcasecmp': identifier not found  

在这种类型的代码中:

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

vs 中的替换是什么?我在网上找不到任何东西

【问题讨论】:

    标签: visual-studio-2008 cygwin porting


    【解决方案1】:

    将此添加到您的预编译头文件(或其他一些 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】:

      寻找

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

      【讨论】:

      • 谢谢你的回答,但你能扩大一点吗?现在是否为 vs 库替换了 strcasecmp?
      • @Meep strcasecmp()是posix指定的函数,MSVC不支持。
      猜你喜欢
      • 1970-01-01
      • 2015-08-03
      • 2013-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-31
      • 1970-01-01
      相关资源
      最近更新 更多