在Visual Studio中,有一个选项可以告诉编译器将警告视为错误,如何使用Qt Creator设置它(我使用VS2008作为编译器)。
I needed to add
QMAKE_CXXFLAGS += /WX
to my .pro file.
For both compilers (VS and MinGW) use:
win32-g++ {
QMAKE_CXXFLAGS += -Werror
}
win32-msvc*{
QMAKE_CXXFLAGS += /WX
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.