Eclipse Mars - 为C ++项目设置默认设置(默认为c ++ 11) [英] Eclipse Mars - set default settings for C++ project (c++11 set by default)
问题描述
我从其他答案发现,在我的Eclipse Mars CDT我可以设置C ++ 11方言使用:
项目 - >属性 - > C / C ++ Build - >设置 - >工具设置 - > GCC C ++编译器 - >方言 - > ISO C ++ 11(从下拉列表中)
和C ++ 11语法高亮使用:
项目 - >属性 - > C / C ++常规 - >预处理器包括路径,宏等 - >条目 - > GNU C ++ - >添加..(对于CDT用户设置条目) - >预处理器宏:__cplusplus = 201103L
Questrion:
如何将这些属性保存为默认配置,以便在创建新的C ++项目时,我已经设置了它们。
创建模板
您可以为C / C ++新建项目向导创建自己的模板。更多信息,请参见在Eclipse CDT中创建一个新的C ++项目,其设置与另一个项目相同,但这里有一些关于C ++ 。
对于C ++使用 C ++ Hello World Template 作为起点。 C ++和 C模板(源以外)是 isCProject
传递到
NewManagedProject
过程。
使用Elevenator插件
主要设计为使C ++ 11默认, Elevenator 插件可能会解决您的问题。然而,我的答案有一个重要的漏洞,因为我不知道如何自己安装它,因为它与 Cevelop
I have found from other answers that in my Eclipse Mars CDT I can setup C++11 dialect using:
Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Dialect -> ISO C++11 (from drop down list)
and C++11 syntax highlighting using:
Project -> Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Entries -> GNU C++ -> Add.. (for CDT User Setting Entries) -> Preprocessor Macro: __cplusplus=201103L
Questrion:
How to save those properties as default configuration so that when I create new C++ project I will have them already set?
Create a Template
You can create your own template for the C/C++ New Project Wizard. Lots more information in Creating a new C++ Project in Eclipse CDT with the same settings as another project but here is some extras about C++.
For C++ Use C++ Hello World Template as a starting point. The key difference between the C++ and C template (other than the source) is the isCProject
passed to the NewManagedProject
process.
Use the Elevenator Plug-in
Primarily designed to make C++11 default, the Elevenator plug-in may resolve your issues. However my answer has a significant hole in that I don't know how to install it on its own as it comes with Cevelop
这篇关于Eclipse Mars - 为C ++项目设置默认设置(默认为c ++ 11)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!