Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
395 views
Welcome To Ask or Share your Answers For Others

1 Answer

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 of strcmp() that's case-insensitive).

Use -std=gnu++0x instead.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...