Before you begin developing C and C++ applications in the IDE, you should be familiar with the following concepts:
A C or C++ project is a group of C or C++ source files and associated information about how to build and run the project. The IDE stores project information in a project folder that includes a makefile and metadata files. Your source directories do not need to be located in the project folder.
In the IDE, you always work inside of a project. You can create projects that use an IDE-generated makefile to build the project, or create projects that are based on your existing makefiles.
A makefile is a file of shell commands that the make utility uses. Typically, the make utility uses the makefile to determine which portions of a program to compile, but there are other uses also.
The C and C++ project system is built directly on top of the make utility. All of the project commands, like Build Project or Run Project, call targets in the project's makefile. You can therefore build and run your C, C++, or Fortran project outside the IDE exactly as it is built and run inside the IDE.
You do not need to know the make utility to work with the IDE. For a C/C++ Application, Dynamic Library, or Static Library project, you can set all the basic compilation and runtime options in the project's Project Properties dialog box and the IDE automatically updates your makefile. If you know how to work with makefiles, you can customize a project's makefile or write your own makefile for your project. You can create a makefile with the Makefile wizard in the IDE.
For a C/C++ Project with Existing Makefile, the makefile is not updated when you set project properties in the IDE. To change a makefile that was created outside the IDE, you must edit the makefile manually.
If a C/C++ Project with Existing Makefile has a configure script, a qmake *.pro script, or CMakeLists.txt script, the script is run during project creation to create the makefile. After the project is created, if you need to change the makefile, you can rerun the project's script from the command line. If you prefer to work within the IDE, you can reconfigure the project by right-clicking the project node and selecting Code Assistance > Reconfigure Project... The IDE will run the project's script to regenerate the makefile, and do a clean build of the project.
If the project is a qmake or cmake project, you can edit the *.pro or CMakeLists.txt file before reconfiguring if you want.
See also | |
---|---|
C and C++ Development Overview |