DaV*_*nci 21 c++ mingw googletest c++11
我目前正在尝试使用googletest与MinGW,-std=c++0x但它抱怨_stricmp is not declared in this scope当我不使用它时它不会-std=c++0x.我不知道是什么_stricmp,我刚刚发现它已定义cstring/string.h,所以为什么它在C++ 0x中消失了?
Mic*_*urr 23
该-std=c++0x选项导致g ++进入'严格ANSI'模式,因此它不会声明非标准函数(并且_stricmp()是非标准函数- 它只是一个strcmp()不区分大小写的版本).
请-std=gnu++0x改用.
除了Michael的解决方案之外,还有其他覆盖strict ANSI模式的方法.在包含编译问题的文件中包含以下内容之前:
#ifdef __STRICT_ANSI__
#undef __STRICT_ANSI__
#endif
Run Code Online (Sandbox Code Playgroud)
这不仅有助于_stricmp也像其他常用功能swptintf,vswprintf并simmilar.
| 归档时间: |
|
| 查看次数: |
7821 次 |
| 最近记录: |