我想在Windows(Qt Creator 2.0.1)下使用Qt Creator中的新C++ 0x功能。C++ 0x與Qt Creator
我閱讀了線程Configuring the GCC compiler switches in Qt, Qt Creator, and QMake並將QMAKE_CXXFLAGS += -std=c++0x
添加到.pro文件。
它之後Qt Creator中給了我這個簡單的代碼很奇怪的錯誤:
#include <memory>
int main()
{
}
編譯器錯誤:
'::的swprintf' 尚未聲明
「:: vswprintf'還沒有宣佈
我試着編譯我的代碼fr om命令行命令g++ test.cpp --std=c++0x
並得到相同的錯誤。
那麼Qt MinGW編譯器有什麼問題?是否可以在Qt Creator中使用C++ 0x功能?
重複問題:http://stackoverflow.com/questions/4713713/include-iostream-with-std-c0x-is-broken。你所要做的就是在庫頭文件中註釋`using :: swprintf;`和`using :: vswprintf;` - 查看ssmir答案中提到的補丁。 – TonyK 2011-02-15 12:47:37