g++ error: ‘stricmp’ was not declared in this scope (but OK for 'strcmp')

前端 未结 5 1643
[愿得一人]
[愿得一人] 2020-12-09 02:26

I am trying to compile the following very very simple piece of source code:

#include 
// #include 
// using namespace std;

cl         


        
5条回答
  •  庸人自扰
    2020-12-09 02:39

    Add a define for it to overwrite stricmp with strcasecmp on the platforms you are looking for.

    #ifdef _IPHONE <- your platform define here
    #define stricmp strcasecmp
    #define strnicmp strncasecmp
    #endif
    

    Then you can just use stricmp always.

提交回复
热议问题