# Creating a project

You need to create a project to contain your source code and related files. A project has an associated builder that can incrementally compile source files as they are changed.

To create a project:

1. Select File > New > Project.

   When you create a new project, you are required to specify the project type. This project type will determine the toolchain, data, and tabs that the CDT uses/displays.

2. Select the type of project to create. For this tutorial, expand the C++ folder and select C++ Project.

   The C++ Project wizard opens. Click here to see an illustration.

   By default, the CDT filters the Toolchain and Project types that currently display in those lists are based on the language support for the C++ Project wizard you selected for this tutorial.

3. In the Project name field, type HelloWorld.
4. Leave the Use Default Location option selected.

   Next, you want to select the type of project to create. In the New CDT Project Wizard, you can choose from the following project types:

   - Executable - Provides an executable application. This project type folder contains three templates.
     - Hello World C++ Example provides a simple C++ Hello World application with main().
     - Hello World ANSI C Example provides a simple C Hello World application with main().
     - Empty Project provides a single source project folder that contains no files.

     After you select a template, the result is a project with only the meta-data files required for the project type. You are expected to modify these source files, as required, and provide source files for the project's target.

     The makefile for the Executable project type is automatically created by the CDT.

   - Shared Library - An executable module that is compiled and linked separately. When you create a project that uses a shared library (libxx.so), you define your shared library's project as a Project Reference for your application. For this project type, the CDT combines object files together and joins them so they're relocatable and can be shared by many processes. Shared libraries are named using the format libxx.so.version, where version is a number with a default of 1. The libxx.so file usually is a symbolic link to the latest version. The makefile for this project type is automatically created by the CDT.
   - Static Library - A collection of object files that you can link into another application (libxx.a). The CDT combines object files (i.e. *.o) into an archive (*.a) that is directly linked into an executable. The makefile for this project type is automatically created by the CDT.
   - Makefile Project - Creates an empty project without the meta-data files. This selection is useful for importing and modifying existing makefile-based projects; a new makefile is not created for this project type.

   By default, the CDT filters the Toolchain and Project types that currently display in those lists based on the language support for the C++ Project wizard you selected for this tutorial.

5. From the Project types list, expand Executable and select Hello World C++ Example. This project type provides a simple Hello World application in C++, and the makefile is automatically created by the CDT.
6. Select a required toolchain from the Toolchain list.

   A toolchain is a set of tools (such as a compiler, linker, and assembler) intended to build your project. Additional tools, such as a debugger, can be associated with a toolchain.
   There can be several toolchains available, depending on the compilers installed on your system.

7. Click Next.
8. Click Advanced Settings.
9. Click the Binary Parser tab.

   Click here to see an illustration.

10. In the Binary Parser list, select PE Windows Parser.

To ensure the accuracy of the C/C++ Projects view and the ability to successfully run and debug your programs, selecting the correct parser is important. After you select the correct parser for your development environment and build your project, you can view the components of the .o file in the C/C++ Projects view. You can also view the contents of the .o file in the C/C++ editor.

11. Click Finish.
12. If a message box prompts you to change perspectives, click Yes.

Your new project displays in the C/C++ Projects view, and in the Navigator view. Your project is empty because you have not yet created files for your project. You can now start writing the code for your HelloWorld program.

Tip: You can view and modify the properties of your HelloWorld project by right-clicking on the project in the C/C++ Projects view and clicking Properties.

Next: Creating your C++ file

For more information about:

- Projects, see Workbench User Guide > Concepts > Workbench > Resources
- The workspace, see Workbench User Guide > Tasks > Upgrading Eclipse

CDT overview
CDT projects
Project file views

Working with C/C++ project files

C/C++ Projects view