Eclipse Mars - 为C ++项目设置默认设置(c ++ 11默认设置) [英] Eclipse Mars - set default settings for C++ project (c++11 set by default)

查看:246
本文介绍了Eclipse Mars - 为C ++项目设置默认设置(c ++ 11默认设置)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从其他答案中发现,在我的Eclipse Mars CDT中,我可以使用以下方式设置C ++ 11方言:



项目 - >属性 - > C / C ++ Build - >设置 - >工具设置 - > GCC C ++编译器 - >方言 - > ISO C ++ 11(从下拉列表)



和C ++ 11语法高亮使用:



项目 - >属性 - > C / C ++常规 - >预处理器包括路径,宏等 - >条目 - > GNU C ++ - > Add ..(用于CDT用户设置条目) - >预处理器宏:__cplusplus = 201103L



Questrion:

如何将这些属性保存为默认配置,以便当我创建新的C ++项目时,我将会设置它们。

解决方案

创建模板



您可以为C / C ++新建项目向导创建自己的模板。在在Eclipse CDT中创建一个与另一个项目相同的设置创建一个新的C ++项目的更多信息,但这里有一些关于C ++ 。



对于C ++使用 C ++ Hello World Template 为例。 C ++和 C模板(源代码除外)是 isCProject 传递给 NewManagedProject 进程。



使用Elevenator Plug-在



主要设计为使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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆