Eclipse Mars - set default settings for C++ projec

2020-03-04 20:49发布

问题:

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?

回答1:

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