【发布时间】:2011-06-27 13:47:57
【问题描述】:
我正在尝试在 Windows (Qt Creator 2.0.1) 下使用 Qt Creator 中的新 C++0x 功能。
我阅读了主题 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' 尚未声明
我尝试使用命令g++ test.cpp --std=c++0x 从命令行编译我的代码并得到同样的错误。
那么 Qt MinGW 编译器有什么问题? Qt Creator 中是否可以使用 C++0x 功能?
【问题讨论】:
-
重复问题:stackoverflow.com/questions/4713713/…。您所要做的就是在库头文件中注释掉
using ::swprintf;和using ::vswprintf;- 请参阅 ssmir 的答案中提到的补丁。
标签: c++ qt c++11 mingw qt-creator