To get more information about using C + + applications in the NetBeans IDE, see the C + + Application Learning Course page on the NetBeans Web site.
Tutorial Requirements
Before continuing, make sure that you have reviewed the requirements in this section.
Prerequisite
This tutorial assumes that you already have some programming experience in C and C + +.
The software required for this tutorial
Before you begin, you will need to install NetBeans 6.0. The C + + download options include NetBeans IDE 6.0 and C + + support.
What's the problem?
One of the responsibilities of the IDE is to build the code model. Code modeling is important for IDE features, such as:
Code completion
Hyperlinks
Navigation
To generate the model correctly, the IDE needs information about the project, such as:
Compiled files
which compiler to use
User contains path and macros in each compiled file
Header file to use
Without this information, the IDE cannot generate the appropriate model, which will cause the IDE's functional work to be faulty.
Of course, all this information is contained in makefile. The problem is that it is difficult to determine the necessary information for the following reasons:
A complex open source project usually has a hierarchical file structure, and the main makefile references the makefile under the subdirectory.
Makefile often use shell script commands.
Sometimes the behavior of the make utility depends on the action that precedes it, for example, based on the existence of the file created in the previous step.
The Netbeans IDE provides another way to get the necessary information for the model, based on compiler comments or debugging information in the following files:
Object files
Static or dynamic libraries
Executable file
What if the job?
Let's examine the typical scenario when creating a new Netbeans IDE project for an open source application.
This starts with downloading an open source project. We use MySQL project. The following instructions assume that we have loaded the open source project and installed the necessary software. Now we're going to configure this project.
To ensure the integrity of the compiler annotation, we provide additional compilation flags:
./configure CFLAGS="-g3 -gdwarf-2" CXXFLAGS="-g3 -gdwarf-2"