The following tutorial takes you though the process of importing a 'legacy' application using the CDT.
Step 1: You want to create a single project that will reflect all of the components for the existing source tree.
The New Project wizard displays.
Click
here to see an illustration (displayed in a separate window).
In this example, we will use an existing hello.cpp
and its
existing hello.mak
makefile, located in the directory c:\brandon
.
Click here to see an illustration (displayed in a separate window).
You will see the new project in the Project Explorer view. In addition, new 'dot' files have been created in your legacy project's root directory, these are CDT project files.
Click here to see an illustration (displayed in a separate window).
Click here to see an illustration (displayed in a separate window).
Click here to see an illustration (displayed in a separate window).
Step 2: You are now ready to build your project.
"make: *** no rule to make target 'all'.
This is because, in our case, we didn't tell it where the makefile is, or its name.
make
command to make -f hello.mak
since our makefile is not named the default makefile
.
Click here to see an illustration (displayed in a separate window).
After the project build completes, the results display in the Console view and new objects, such as binaries and includes, show in the Project Explorer view.
Click here to see an illustration (displayed in a separate window).
Note: By default, the indexer is set to Fast indexer for the project to parse your project in the same way that a compiler does; beginning with each compilation unit and parsing that file and all files that it includes, except that it parses each header file included in a project only once. This method provides the most accurate index information. For large projects using complex C++ code, this indexer can be slow. For example, if a header file is included and takes two compilation units, the parsing of the second unit reuses the results of parsing the first unit. This is similar to how precompiled headers work. The indexing of large projects using the Fast indexer uses fewer resources than the Full indexer, but the resulting index is not quite as accurate.
Click here to see an illustration (displayed in a separate window).
Step 3: You are now ready to run your application.
The Run Configurations dialog displays.
In our case it didn't find the file because it's in a nonstandard location.
Use the Browse button to select the executable. In our case also it's a nonstandard
name, hello.e
because that's what our makefile hello.mak
built.
Click here to see an illustration (displayed in a separate window).
Click here to see an illustration (displayed in a separate window).
The application runs in the Console view. The Console also shows which application it is currently running in the title bar. You can configure the view to display different elements, such as user input elements using different colors.