刚在mac mini上安装Qt4.8.4
qmake和clang3.2好不容易装上去后
却发现clang3.2不支援C++11
clang3.2的binary
QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = test00 TEMPLATE = app CONFIG += -std=gnu++11 SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui
#include <functional> #include <iostream> #include <memory> #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); auto A = 444; //警告, std::cout<<A<<std::endl; std::unique_ptr<int> B; //错误讯息 return a.exec(); 警告 :
auto' type specifier is a C++11 extension [-Wc++11-extensions]错误讯息 :
error: expected '(' for function-style cast or type construction
std::unique_ptr<int> B