Eclipse CDT 4.4 Luna和4.5 Mars的说明
首先,在创建项目之前,配置Eclipse语法解析器:
Window-> Preferences-> C/C++-> Build-> Settings-> Discovery->CDT GCC Build-in Compiler Settings
在标题为“ Command to get compiler specs附加” 的文本框中-std=c++11
现在您可以创建项目,配置取决于您创建的项目类型:
对于创建为的项目:文件->新建->项目-> C / C ++-> C ++项目
右键单击创建的项目并打开
Properties-> C/C++ Build-> Settings-> Tool Settings-> GCC C++ Compiler->Dialect
放入-std=c++11标题为other dialect flags或ISO C++11从Language standard下拉列表中选择的文本框。
对于CMake项目
生成Eclipse项目文件(在项目内部)
mkdir build
cd build
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ..
然后将生成的目录导入到Eclipse中作为标准Eclipse项目。右键单击项目并打开
Properties-> C/C++ General-> Preprocessor Include Paths, Marcos etc.->Providers
启用CDT GCC Build-in Compiler Settings并将其移动到更高位置Contributed PathEntry Containers(这很重要)
最后共同步骤
重新编译,重新生成Project-> C/C++ Index并重新启动Eclipse。
std::unique_ptr<char[]>