I'm currently trying to use googletest with MinGW and -std=c++0x
but it complains that _stricmp is not declared in this scope
which it doesn't when I do not use -std=c++0x
.
I have no idea what _stricmp
is, I just found out that it is defined in cstring/string.h
, so why is it gone in C++0x?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
The
-std=c++0x
option causes g++ to go into 'strict ANSI' mode so it doesn't declare non-standard functions (and_stricmp()
is non-standard - it's just a version ofstrcmp()
that's case-insensitive).Use
-std=gnu++0x
instead.In addition to solution by Michael there is other method for overriding
strict ANSI
mode. Include the following before any includes in file with compilation problems:This helps not only with
_stricmp
also with other common functions likeswptintf
,vswprintf
and simmilar.You can take a look at MinGW-w64, which allowed me to run Google Tests with -std=c++11 (works with your -std=c++0x as well). It eliminates problems with _stricmp, _strdup and so forth.