4.5 Projects


4.5 Projects

When a programmer sits down to write a new program in an IDE, he creates a new project. This project will contain all the instruction text files written in C++ and any other files deemed to be relevant. C++ files typically have the file extensions .c, .cpp, .h, and .hpp. When the time comes to assemble the program into an executable form, all the files contained in a project are typically compiled together by the compiler, and then the program can be run. If there's a problem with the program, programmers can go back and edit the source code, compile again, and run to see the new program with changes included.

Creating a new project is the first step to perform when preparing to write a new program. The procedure for doing this will be slightly different depending on which IDE the reader has selected.

4.5.1 Starting a New Visual C++ Project

To create a new project in Visual Studio .NET, perform the following:

  1. Click File | New | Project.

  2. In the New Project dialog, select Visual C++ Projects from the Project Types tree view.

    image from book
    Figure 4.4

  3. In the Templates box, a number of different project types for C++ are listed. Any kind can be selected, but I recommend starting with Win32 Console Application.

  4. In the Name and Location edit boxes beneath, select a name for the project and a location where it is to be saved.

  5. Click OK.

  6. A wizard dialog appears in which application settings can be customized. To start, it's probably sensible to accept the defaults.

    image from book
    Figure 4.5

  7. Click Finish.

  8. A new project is then ready to begin.

4.5.2 Starting a New Code::Blocks Project

To create a new project in Code::Blocks, perform the following:

  1. Click File | New | Project.

  2. A number of different project types for C++ are listed in the large box. Any kind can be selected, but I recommend starting with Console Application.

    image from book
    Figure 4.6

  3. Click Go.

  4. A wizard dialog appears where users can enter a project name and a location where the project will be saved. Click Next.

    image from book
    Figure 4.7

  5. The next wizard dialog gives the user some configuration options. Unless you have specific requirements, you can simply click Next.

    image from book
    Figure 4.8

  6. A new project is then ready to begin.

4.5.3 Starting a New Dev C++ Project

To create a new project in Dev C++, perform the following:

  1. Click File | New | Project.

  2. A number of different project types for C++ are listed in the New project dialog. Any kind can be selected, but I recommend starting with Console Application.

    image from book
    Figure 4.9

  3. Click OK.

  4. A dialog appears in which users can enter a location where the project will be saved.

  5. A new project is then ready to begin.




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net