5.3. Creating the Example Project

nmake should be on your PATH before starting Eclipse. In addition, a C compiler called cc should be on your PATH, alternatively point environment variable CC to your C compiler (for example, export CC=/usr/bin/gcc). Once in Eclipse, turn off automatic project builds by selecting Project > Build Automatically.

  1. Select File > New > Project... > C/C++ > C Project.

  2. Click Next.

  3. Enter a project name, for example, hw. This will become the basename of various elements of the generated example project, such as commands and libraries. Consequently, you probably want to avoid spaces in the project name.

  4. Select nmake Makefile Project - GCC > nmake Hello World C Project.

  5. Select both toolchains nmake Makefile - Linux gcc/debug and nmake Makefile - Linux gcc/release, or the equivalent for your platform (use shift-click to add a toolchain to existing selection.)

Figure 6. CDT project creation wizard—template project type and toolchain selection.

nmake cdt plugin template project type and toolchains

  1. Click Next.

  2. Enter properties for the example project. These will appear in the generated project as appropriate, such as in generated source file prologue comments.

Figure 7. CDT project creation wizard—template properties dialog.

nmake cdt plugin template properties dialog

  1. Click Next, then Finish.

  2. Click Yes if Eclipse offers to open the C/C++ perspective.

  3. A new project using the supplied project name should appear in the Project Explorer.