To begin with, this can be the simplest way to build a new Project. (But it only works with GCC and other Eclipse supported toolchains.) [1]
CDT gives a GUI to:
With Eclipse managed build, Eclipse can automatically create a set of makefiles. These make files can be used with standard make utility. Thus, if the project is managed within Eclipse, developers not using Eclipse can still build the software. It is also useful for automated standalone builds.
Note
Older versions of CDT used to refer this as a Managed make project
Click
Select C Project
Name the project as Hello World.
Select project type as Hello World ANSI C Project
Select Tool-chain as MinGW GCC
Click
buttonInput your details
Click
buttonSelect
Select Current builder
as
Click
buttonClick
buttonIf you get a message to switch perspective, Click Yes
This happens if the previous perspective was not C/C++ perspective.
This is how the Project Explorer view would look like.
To build the project, do either of:
Press Ctrl + B
Click
Press the
Build configurations are different ways of building a code. The most basic would be debug mode and retail mode. In debug mode, the generated objects and executables have debug symbols. For large projects, this can become further complicated. Including files for test code, excluding files for test code, etc.
Each configuration can have unique set of source files, includes, #defines, and other compiler/linker parameters.
Eclipse gives control over how the project gets build.
Even finer control can be achieved through, Including / Excluding files & directories from build)
(SeeThrough Add include paths to build.
we canThrough Add compiler defines to build.
we canTo Change the default build utility, from make
to something
else, go to
To change Advanced build settings , e.g. using Parallel jobs for build (-j), or build on every save, go to
The toolchain can be selected form
.To Change general settings of the Tool-Chain, like, enable warnings
(-Wall
), don’t include standard system header files during compilation
(-nostdinc
), etc. go to
We can also Change the build artifacts (dll/lib/exe). We can control if we want to build a DLL/Shared Object, static library, or an executable out of this project.
To Add pre-build and post-build steps, go to
[1] | Cygwin GCC, Linux GCC, MacOSX GCC, MinGW GCC, Solaris GCC are supported by default. The proprietary distributions based on Eclipse would also support the toolchains of that distribution. |