OS : OS X 10.8.1 QtCreator : 2.6.2
Command line is fine, but QtCreator fail to compile the codes.
#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;
}
Command line :
clang++ -stdlib=libc++ -std=c++11 main.cpp -o test
Compiler setting of QtCreator http://www.flickr.com/photos/92283971@N04/8453188038/in/photostream
Qt .pro file
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS += -stdlib=libc++
Error message:
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) make: *** [main.o] Error 1
But my OS number is 10.8.1