OS:OS X 10.8.1 QtCreator:2.6.2鐺++ QtCreator下不能使用C++工作11
命令行是好的,但QtCreator無法編譯代碼。
#include <functional>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
int main(int argc, const char * argv[])
{
std::vector<std::string> strs{"yahoo", "haha"};
for(auto const &data : strs){
std::cout<<data<<std::endl;
}
std::vector<std::string> strs2 = std::move(strs);
std::unique_ptr<int> A(new int(3));
std::cout<<*A<<std::endl;
return 0;
}
命令行:QtCreator http://www.flickr.com/photos/[email protected]/8453188038/in/photostream
Qt的pro文件的
clang++ -stdlib=libc++ -std=c++11 main.cpp -o test
編譯器設定
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS += -stdlib=libc++
錯誤消息:
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make: *** [main.o] Error 1
但我的操作系統數量爲10.8.1
感謝您的幫助!你能鏈接到Qt錯誤嗎? – Grault