1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

bug 280125 - more fixes in docs

This commit is contained in:
Vivian Kong 2009-06-16 21:38:17 +00:00
parent 6d14f5aa73
commit 7156f656f6
30 changed files with 310 additions and 156 deletions

View file

@ -60,19 +60,25 @@ the Make Targets view.</li>
<p>For more information about the Tasks view, see <b>Workbench User
Guide &gt; Reference &gt; User interface information &gt; Views and
editors &gt; Tasks view</b>.</p>
<h2>Getting a makefile</h2>
<p>You can either create a C/C++ project for which you supply the <b>makefile</b>
or create a C/C++ project for which the CDT generates makefiles
automatically.</p>
<p>To create a new project, from the menu bar choose <b>File &gt; New
&gt; Project</b>. In the dialog that appears:</p>
&gt; Project</b>. In the dialog that appears, expand the C/C++ group
and choose e.g. C Project</p>
<ul>
<li>To create a project for which you supply the <b>makefile</b>,
select either <b>Standard Make C project</b> or <b>Standard Make C++
project</b>. </li>
<li>In the resulting wizard page, to create a project for which you supply the <b>makefile</b>,
select <b>Makefile project</b> and choose one of the alternatives under that.
An empty project, or a simple "Hello World" can be created.
You edit and manage the makefile yourself.
<p>&nbsp;</p>
</li>
<li>To create a project for which the CDT supplies a basic <b>makefile</b>,
select either <b>Managed Make C project</b> or <b>Managed Make C++
project</b>. </li>
select another project type, e.g. <b>Executable</b> and choose one of the examples
under that, or choose <b>Empty Project</b>.
</li>
</ul>
<h2>Setting build preferences</h2>
<p>You can set build preferences in Eclipse:</p>
@ -81,42 +87,47 @@ project</b>. </li>
<dd>If certain projects must be built before others, you can set the <i>build
order</i>. If your project refers to another project, the CDT must
build the other project first. To set the build order, from the menu
bar select <b>Window &gt; Preferences &gt; Build Order</b>.
bar select <b>Window &gt; Preferences</b> and choose <b> General > Preferences > Build Order</b>.
<p>When you set the build order, the CDT does not rebuild projects
that depend on a project; you must rebuild all projects to ensure all
changes are propagated.</p>
</dd>
<dt>Automatic save</dt>
<dd>You can set the CDT to perform an <i>automatic save</i> of all
modified resources when you perform a manual build; from the menu bar,
select <b>Windows &gt; Preferences &gt; Workbench</b>. By default,
this feature is enabled.</dd>
modified resources when you perform a manual build. In the preferences dialog,
select <b>General > Workspace</b> and check <b>Save automatically before build</b>.
By default,
this feature is <i>not</i> enabled.</dd>
</dl>
<h2>Controlling the building of your project</h2>
<p>For a Standard Make project, the C/C++ compiler that a project uses
<p>For a Makefile project, the C/C++ compiler that a project uses
is controlled by the project's <b>Properties</b> setting.
To view a project's properties, right-click on the project and select <b>Properties</b>.
In the dialog that appears, the <b>C/C++ Standard Make Project</b>
In the dialog that appears, the <b>C/C++ Build</b>
page enables you to control a variety of settings, including:</p>
<dl>
<dt>Build Setting</dt>
<dd>Controls whether the compiler will <b>Stop On Error</b> or <b>Keep
Going On Error</b>. Choosing <b>Keep Going On Error</b> will force the
compiler to attempt to build all referenced projects even if the
current project has errors.</dd>
<dt>Build Command</dt>
<dd>Controls which make is used.</dd>
<dt>Workbench Build Behavior</dt>
<dd>Controls which makefile target will be built depending on the
scope of the build.</dd>
<dt>Build Command</dt>
<dd>On the <b>Builder Settings</b> tab, this controls which <code>make</code> is used. To change it, uncheck <b>Use
default build command</b> and change it or add arguments to the make command.</dd>
<dt>Build Setting</dt>
<dd>On the <b>Behaviour</b> tab, this controls whether the compiler will <b>Stop on first build error</b> or not
(keep going). Unchecking <b>Stop on first build error</b> will force the compiler to attempt to build all referenced
projects even if the current project has errors.</dd>
<dt>Workbench Build Behavior</dt>
<dd>On the <b>Behaviour </b> tab, this controls which makefile target will be built depending on the scope of the
build, e.g. <code>all</code> or <code>clean</code>.</dd>
</dl>
<p>For a Managed Make project, the project properties dialog enables
<p>For a standard (non-Makefile) project (often called "Managed Build" or "Managed Make" project from
earlier CDT version), the project properties dialog enables
you to manage the build configurations of your project. For additional
information see:</p>
<ul>
<li><b>Reference &gt; C/C++ Project Properties &gt; Managed Make
<li><b>Reference &gt; C/C++ Properties &gt; C/C++ Project Properties &gt; Managed Make
Projects</b></li>
<li><b>Reference &gt; C/C++ Project Properties &gt; Managed Make File
<li><b>Reference &gt; C/C++ Properties &gt; C/C++ Project Properties &gt; Managed Make File
Properties</b></li>
</ul>
<h2>Viewing build information</h2>

View file

@ -105,7 +105,7 @@ items:</p>
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
<br>
<a href="../tasks/cdt_t_show_proj_files.htm">Displaying C/C++ file components in the
C/C++ Projects view</a><br>
Project Explorer view</a><br>
<a href="../tasks/cdt_t_search.htm">Searching for C/C++ elements</a></p>
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
<br>

View file

@ -41,10 +41,10 @@ views:</p>
<h3>CDT updates</h3>
<p>The <b>Install/Update</b> wizard provides information about your current Eclipse installation and provides the framework to manage your updates.
For more information, see <b>Workbench User Guide &gt; Tasks &gt; Updating features with the update manager</b>.</p>
For more information, see <b>Workbench User Guide &gt; Tasks &gt; Updating and installing software</b>.</p>
<p>To view a list of the updates available for the toolsets that you
installed, click <b>Help &gt; Software Updates &gt; New Updates</b>.</p>
installed, click <b>Help &gt; Check for Updates</b>.</p>
<h3>Additional information</h3>
@ -60,13 +60,6 @@ Provides answers to the most common questions about using the CDT.</li>
<li><a href="http://wiki.eclipse.org/index.php/CDT">CDT Wiki</a>:
This is the main source for information around CDT.</li>
<!-- the following links are rather outdated -->
<li><a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/cdt-home/developer/docs.html?cvsroot=Tools_Project">Developer
Documentation</a>: Provides feature and design specifications for building and extending the CDT.</li>
<li><a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/cdt-home/community.html?cvsroot=Tools_Project">CDT
Community Webpage</a>: Showcases plug-ins and tools developed by and for the CDT Community.
If you have tools or plug-ins that you would like to submit to the CDT Community Page,
use the CDT Development Mailing List or the Eclipse Tools CDT newsgroup.</li>
</ul>

View file

@ -16,6 +16,7 @@ Each type of perspective is a combination of views, menus, and toolbars that ena
For example, the C/C++ perspective has views that are organized to help you develop C/C++ programs;
the <b>Debug</b> perspective has views that enable you to debug those programs.
</p>
<p>To Open the C/C++ Perspective, select Window > Open Perspective > Other... and select C/C++</p>
<div class="note">

View file

@ -37,7 +37,9 @@ may contain other information.
<td>
<p align="right"><b>Rename in File</b></p>
</td>
<td>The rename refactoring now works interactively in the editor.
<td>To make rename refactoring work interactively in the editor,
position the cursor on an identifier in the editor and hit Cntl-1
(the hotfix key). Choose "Rename in file."
Changing an identifier simultaneously changes all other references to that identifier.
<p><img src="../images/60/RenameInFile.png" alt="Rename in File">
</td>
@ -173,21 +175,39 @@ may contain other information.
<p>&nbsp;</p>
</li>
</ul>
</td>
</tr>
<tr>
<td>
<p align="right"><b>System Includes</b></p>
</td>
<td>
<ul>
<li>Heuristics to pick up otherwise unresolved include files from the project
<li>Heuristics to pick up otherwise unresolved include files from the project
<p>In older versions of CDT the user was forced to manually set up all include paths that were not discovered by
the build system. Now CDT is capable of automatically finding any header file that is located within the project
without manual setup.
<p>(See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=213562">Bug 213562</a>)
</p><p>&nbsp;</p>
<p>(See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=213562">Bug 213562</a>)</p>
<p>&nbsp;</p>
</li>
<li>Rework of template instantiation
</ul>
</td>
</tr>
<td>
<p align="right"><b>Indexer Accuracy</b></p>
</td>
<td>
<ul>
<li>Rework of template instantiation
<p>
There have been significant improvements to the CDT editor for supporting C++ templates. Content assist now works
much better within code that makes heavy use of templates.</p>
<p>&nbsp;</p>
</li>
<li>There have been numerous improvements to the performance and accuracy of the CDT parser and indexer.</li>
<li>
There have been numerous improvements to the performance and accuracy of the CDT parser and indexer.</li>
</ul>
</td>
</tr>
@ -236,7 +256,7 @@ may contain other information.
<ul>
<li>Updated Manage Working Set Configurations dialog for simpler workflows</li>
<li>Quick access to configurations via a property page for Working Sets
<img src="../images/60/New_cdtwsconfig_wsProperties.png" alt="New working set configuration dialog">
<br></br><img src="../images/60/New_cdtwsconfig_wsProperties.png" alt="New working set configuration dialog">
<p>&nbsp;</p>
</li>

View file

@ -10,7 +10,7 @@
<body>
<h1>C/C++ Development User Guide</h1>
<p>CDT 5.0</p>
<p>CDT 6.0</p>
<p>The C/C++ Development Toolkit (CDT) is a collection of Eclipse-based features that provides the capability
to create, edit, navigate, build, and debug projects that use C and/or C++ as a programming language.</p>

View file

@ -14,10 +14,11 @@
<img src="../images/trans.gif" border="0" width="25" height="1" alt=""><a style="text-decoration:none" href="cdt_w_prepare_workbench.htm">Prepare the Workbench</a><br>
<img src="../images/trans.gif" border="0" width="25" height="1" alt=""><a style="text-decoration:none" href="cdt_w_newproj.htm">Create a new project</a><br>
<img src="../images/trans.gif" border="0" width="25" height="1" alt=""><a style="text-decoration:none" href="cdt_w_basic.htm">Create a simple application</a><br>
<img src="../images/trans.gif" border="0" width="25" height="1" alt=""><a style="text-decoration:none" href="cdt_w_newproj.htm">Create a Makefile project</a><br>
<img src="../images/trans.gif" border="0" width="25" height="1" alt=""><a style="text-decoration:none" href="cdt_w_import.htm">Import an existing project </a><br>
<img src="../images/trans.gif" border="0" width="25" height="1" alt=""><a style="text-decoration:none" href="cdt_w_build.htm">Build a project</a><br>

View file

@ -15,12 +15,12 @@ function newWin(url) {
<p>In this tutorial, you will use the CDT to create a simple 'Hello World' application.
This tutorial describes the process of creating a new C++ project where the build is
automatically managed by the CDT.</p>
automatically managed by the CDT, and running the program.</p>
<p>Note: In earlier versions of the CDT, there were two separate project types:
Managed make (automatically generated a makefile)
and Standard make (required the user's makefile to build).
With CDT 4.0, you now select a project type, and that determines what build system will be used.</p>
Now with CDT, you now select a project type, and that determines what build system will be used.</p>
<p>To create a simple "Hello World" application using the CDT, you will perform the following steps:</p>
@ -30,7 +30,7 @@ With CDT 4.0, you now select a project type, and that determines what build syst
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_basic02.png')">Click here to see an illustration (displayed in a separate window)</a>.</p><br></li>
<li>Select the type of project to create. For this tutorial, expand the <b>C++</b> folder and select <b>C++ Project</b> and click <b>Next</b>.
<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_basic03a.png')">Click here to see an illustration.</a><br></p>
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_basic03a.png')">Click here to see an illustration.</a><br></p>
<p><br>The <b>C++ Project</b> wizard opens.</p>
<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_basic04.png')">Click here to see an illustration.</a><br></p>
<p><br>By default, the CDT filters the <b>Toolchain</b> and <b>Project types</b> that it displays in those lists based on the language support for the C++ Project wizard you selected for this tutorial.</p>

View file

@ -5,23 +5,39 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Building your project</title>
<link rel="stylesheet" type="text/css" href="../help.css">
<script language="JavaScript">
function newWin(url) {
window.open(url, 'install_cdt', 'width=750, height=700, menubar=no, toolbar=no, status=no, resizable=yes, location=no, scrollbars=yes');
}
</script>
</head>
<body>
<h1>Building a project</h1>
<p>The make output and build progress information displays in the
Console view. The Make Targets view displays makefile actions, and the
Tasks view displays compile warnings or errors.</p>
<p>To build a project:</p>
<ol>
<li>In the <b>C/C++ Projects</b> view, select your project. For the tutorial, you can to select the <b>Hello World</b> project you created earlier. <p><br></p></li>
<li>Click <b>Project &gt; Build Project</b>.</li>
<p>If you see the error message:</p>
<br>
<p><samp>Exec error:Launching failed</samp></p>
<br>
<li>In the <b>Project Explorer</b> view, select your project. For the tutorial, you can select the <b>HelloWorld</b> project you created earlier. <p><br></p></li>
<li>Click <b>Project &gt; Build Project</b>.
<br>You can also hit the hammer icon <img src="../images/hammer-icon.png"> on the toolbar.
</li>
<p>If you see an error message, such as:</p>
<p><samp>&nbsp;&nbsp;&nbsp;(Cannot run program "make": Launching failed)</samp></p>
<p>then CDT cannot locate the build command, usually <samp>make</samp>.
Either your path is not configured correctly, or you do not have <samp>make</samp>
installed on your system.</p>
<li>You can see the output and results of the build command in the <b>Console</b> view.
Click on its tab to bring the view forward if it is not currently visible.
If for some reason it's not present, you can open it by selecting Window > Show View > Console.
<p> <br>
<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_newmake03.png')">Click here to see an illustration (displayed in a separate window)
</a>.</p>
</li>
</ol>
<p><img border="0" src="../images/ngconcepts.gif" alt="Related concepts"
width="143" height="21">

View file

@ -18,36 +18,55 @@ examining the contents of variables.</p>
<p>To debug a project:</p>
<ol>
<li>Click <b>Run &gt; Debug Configurations...</b>.<p>The Debug Configurations dialog opens.</li>
<li>Double-click <b>C++ Application</b>.</li>
<li>Double-click <b>C/C++ Application</b>.</li>
<li>In the <b>Name</b> field, type <b>Hello World</b>.</li>
<p>You can now select this debug launch configuration by name the next time
that you debug this project.</p>
<li>In the <b>Project</b> box, type <b>hello.exe</b>. [???????]</li>
<li>In the <b>Project</b> box, type or choose your project, e.g. <b>HelloWorld</b>.
<br>
Your executable should be selected under "C/C++ Application."
<br>If not, the <b>Search Project</b> button should find the executable in the project.
<p>&nbsp;</p>
</li>
<ul>
<li>If you see the error "[Debugger]: No debugger available", select the Debugger tab
and choose a valid debugger for your platform (e.g. gdb/mi).
</li>
</ul>
<li>Click <b>Debug</b>.</li>
<p>You will be prompted to switch to the Debug Perspective. Click <b>Yes</b></p>
<p>You will now see the debug perspective with the hello.exe application window open.
The C/C++ editor repositions in the perspective.</p>
<ul>
<li>If you see an error in the editor "Can't find source file" you can use the buttons provided
to point to your source file, e.g. "Locate File."
</li>
</ul>
<li>In the left margin of the main.cpp window, double-click to set a
breakpoint on:<br>
&nbsp;cout &lt;&lt; &quot;You just entered&quot;</li>
<li>Click <b>Run &gt; Resume</b>.</li>
<li>When prompted, type a value other than 'm'.<br>
&nbsp;cout &lt;&lt; &quot;You just entered&quot;
<br>You'll see an icon there indicating the breakpoint is set.</br>
</li>
<li>Click <b>Run &gt; Resume</b>.
<br>Or, you can use the <b>Resume</b> button (green arrow) on the toolbar <i>of the Debug View</i>
</li>
<li>When prompted, in the Console view, type a value other than 'm', and hit Enter/Return.<br>
The breakpoint will be hit.</li>
<li>In the Variable view, verify that the variable is not 'm'.</li>
<li>In the <b>Variables</b> view, verify that the variable is not 'm'.</li>
<li>Click <b>Run &gt; Resume</b>.</li>
<li>When prompted, type a value other than 'm'.</li>
<li>When prompted, again type a value other than 'm' in the Console view, and press Enter/Return.</li>
<p>The breakpoint will be hit.</p>
<li>In the <b>Variable</b> view, verify that the variable is not 'm'.</li>
<li>In the <b>Variable</b> view, right-click the input variable, and select <b>Change
Variable Value</b> and type <b>'m'</b>.</li>
<li>In the <b>Variables</b> view, verify that the variable is not 'm'.</li>
<li>In the <b>Variables</b> view, right-click the input variable, and select <b>Change Value...</b>
and type <b>'m'</b> <i>between the single quotes</i> and hit <b>OK</b>.</li>
<li>Click <b>Run &gt; Resume</b>.</li>
<p>The output in the hello.exe application window is:<br>
&nbsp;&quot;You just entered m, you need to enter m to exit.&quot;<li>Type <b>'m'</b> to end the program.<br>
The hello.exe application window closes and the debug session ends. The debug
&nbsp;&quot;You just entered m, you need to enter m to exit.&quot;
<li>The application terminates and the debug session ends. The debug
perspective remains open.</li>
</ol>
<p>To learn more about the debugging, see to the related debug conceptual topics.</p>
<p>To learn more about debugging, see the related debug conceptual topics.</p>
<p align="left"> <a href="cdt_w_build.htm">
<img border="0" src="../images/ngback.gif" width="16" height="16" alt="Back icon"></a><b> <a href="cdt_w_build.htm">Back: Building a project</a></b>&nbsp;&nbsp;&nbsp; </p>

View file

@ -15,47 +15,131 @@ function newWin(url) {
<body>
<h2>Tutorial: Importing an existing project</h2>
<p>The following tutorial takes you though the process of importing a simple application using the CDT.</p>
<p>The following tutorial takes you though the process of importing a 'legacy' application using the CDT.</p>
<p>Step 1: You want to create a single project that will reflect all of the components for the existing source tree.<br></p>
<p>Step 1: You want to create a single project that will reflect all of the components for the existing source tree.<br></p>
<ol>
<li>Select <b>File &gt; New &gt; Project</b>.
<li>For this tutorial, expand <b>C++</b> and select <b>C++ project</b>.
<p><br>The <b>New Project</b> wizard displays. <a href="javascript:void(0)" onClick="newWin('../images/cdt_w_import02.png')">Click here to see an illustration (displayed in a separate window)</a>.</p> <br>
<li>For this tutorial, expand <b>C/C++</b> and select <b>C++ project</b>.
<p><br>
The <b>New Project</b> wizard displays.
<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_import02.png')">Click
here to see an illustration (displayed in a separate window)</a>.</p>
<br>
<li>In the <b>Project name</b> field, type a name for the project.
<li>Ensure that the <b>Use default location</b> option is not selected because you will need to specify where the resources reside in the file system since they do not reside in your workspace.
<li>In the <b>Location</b> field, specify a path for your project.
<li>From the <b>Project types</b> list, expand <b>Makefile Project</b> and select <b>Hello World C++ Project</b>.
<li>Ensure that the <b>Use default location</b> option is not selected because here we will specify where the
resources reside in the file system, in a location other than your workspace. <br>
We assume this directory location already exists, and contains e.g. source files and makefile. If it does not exist, it
will be created.
<p>In this example, we will use an existing <code>hello.cpp</code> and its
existing <code>hello.mak</code> makefile, located in the directory <code>c:\brandon</code>.
<p>&nbsp;
<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon01.png')">Click
here to see an illustration (displayed in a separate window)</a>.</p>
</p>
<li>In the <b>Location</b> field, specify the path to the existing files for your project.
<li>From the <b>Project types</b> list, expand <b>Makefile Project</b> and select <b>Empty Project.</b>.
<ul>
<li>To have sample source and a makefile created in your existing directory, select <b>Hello World C++ Project</b</li>
</ul>
<li>Make sure a toolchain is selected.</li>
<li>Click <b>Next</b>.
<li>Select only the configurations you want created. Configurations display for each toolchain selected on the previous page of the wizard.
<p>&nbsp;
<li>(Optional) On the <b>Select Configurations</b> page, select only the configurations you want created. Configurations
display for each toolchain selected on the previous page of the wizard.
<li>Click <b>Finish</b> to close the dialog box.
<p>You will see the new project in the C/C++ Projects view. In addition, new 'dot' files in your legacy project's root directory, these are CDT project files.</p>
<p>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.</p>
<ul>
<li>(Optional) To see these "hidden" files, open the view menu on the Project explorer view, and select
"Customize View." <br>
The view menu is activated via the small downward-pointing triangle in the upper right of the toolbar of the view.
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_viewMenu.png')">Click here to see an
illustration (displayed in a separate window)</a>.</p>
<br>
<li>In the <b>Available Customizations</b> window, on the <b>Filters</b> tab, uncheck ".* resources."
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_viewMenuFilters.png')">Click here to see an
illustration (displayed in a separate window)</a>.</p>
<br>
<li>The formerly hidden 'dot' files are now shown in the <b>Project Explorer</b>.
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_viewMenuFilters2.png')">Click here to see an
illustration (displayed in a separate window)</a>.</p>
<br>
</li>
<li>Hit <b>OK</b> to close the dialog.</li>
</ul>
</ol>
<p>Step 2: You are now ready to build your project.<br></p>
<ol>
<li>To build your project, select <b>File</b> &gt; <b>Build Project</b>.
<p>After the project build completes, the results display in the <b>Console</b> view and new objects, such as binaries and includes, show in the <b>Projects</b> view.</p>
<li>To build your project, select <b>Project</b> &gt; <b>Build Project</b>.
<br>You can also hit the hammer icon <img src="../images/hammer-icon.png"> on the toolbar to
build the selected project.
<br>&nbsp;</br>
<li>You may see an error e.g. <code> "make: *** no rule to make target 'all'.</code>
<p>This is because, in our case, we didn't tell it where the makefile is, or its name.</p>
<ul>
<li>Open the project properties (right mouse on project name in the <b>Project Explorer</b> view
and select <b>Properties</b> at the bottom on the context menu).</li>
<li>On the C/C++ Build Page, on its <b>Builder Settings</b> tab, uncheck "Use default build command"
and change the <code>make</code> command to <code>make -f hello.mak</code>
since our makefile is not named the default <code>makefile</code>.
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon02.png')">Click
here to see an illustration (displayed in a separate window)</a>.</p>
</li>
<li>Click <b>OK</b> to close the <b>Project Properties</b> window.
</li>
<li>Your project will probably rebuild. If not you can force a build via
<b>Project</b> &gt; <b>Build Project</b>
or use the hammer icon <img src="../images/hammer-icon.png">.
</li>
</ul>
</li>
<p>After the project build completes, the results display in the <b>Console</b> view and new objects, such as binaries and includes, show in the <b>Project Explorer</b> view.</p>
<p>&nbsp;
<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon03.png')">Click
here to see an illustration (displayed in a separate window)</a>.</p>
<li>Review the results to ensure that there are no errors.
<p><b>Note:</b> By default, the indexer is set to <b>Fast indexer</b> 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.</p>
<p>&nbsp;
<p></p>
<b>Note:</b> By default, the indexer is set to <b>Fast indexer</b> 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.
<br>To change indexer settings, bring up the Indexer page in the Project Properties.
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_indexer.png')">Click here to see an illustration (displayed in a separate window)</a>.</p> <br>
</br>
</p>
</ol>
<p>Step 3: You are now ready to run your application.</p>
<ol>
<li>To run your application within the C/C++ Perspective, click <b>Run &gt; Run</b><p>
<li>To run your application within the C/C++ Perspective, click <b>Run &gt; Run Configurations...</b><p>
<p>The <b>Run Configurations</b> dialog displays.</p>
<li>To create a run configuration, select <b>Local C/C++ Application</b> and click <b>OK</b>.
<li>Select the new run configuration in the <b>Configurations</b> view and click the <b>Main</b> tab to edit your run configuration.
<li>Optional: You can change the name of your run configuration by entering a new name in the <b>Name</b> field.
<li>To select the project, click <b>Browse</b> opposite the <b>Project</b> field.
<li>From the Project Selection window, select the project and click <b>OK</b>.
<li>Select the new <b>C/C++ Application</b> you want to execute by clicking <b>Search</b>.
<li>From the Program Selection window, select an appropriate binary from the list and click <b>OK</b>.
<li>Click <b>Apply</b> to save the run configuration and then click <b>Run</b>.
<li>To create a run configuration, select <b>C/C++ Application</b> and click the <b>New</b> icon.
<li>Give your run configuration a name by entering a new name in the <b>Name</b> field at the top.
<li>On the <b>Main</b> tab, select the project by clicking <b>Browse</b> opposite the <b>Project</b> field.
<ul>
<li>From the Project Selection window, select the project and click <b>OK</b>.
</ul><li>Select the new <b>C/C++ Application</b> you want to execute by clicking <b>Search</b>.
<p>In our case it didn't find the file because it's in a nonstandard location.
Use the <b>Browse</b> button to select the executable. In our case also it's a nonstandard
name, <code>hello.e</code> because that's what our makefile <code>hello.mak</code> built.</p>
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon04run.png')">Click
here to see an illustration (displayed in a separate window)</a>.</p>
<ul>
<li>If you see the error "[Debugger]: No debugger available", select the Debugger tab
and choose a valid debugger for your platform (e.g. gdb/mi).
</li>
</ul>
<li>Click <b>Run</b> to save the run configuration and run it.
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon04run2.png')">Click
here to see an illustration (displayed in a separate window)</a>.</p>
<p>The application runs in the <b>Console</b> view. The <b>Console</b> 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.</p>
</ol>
<img src="../images/ng00_04a.gif" ALT="QNX Copyright Statement" >

View file

@ -14,7 +14,7 @@
<p>You can begin coding your HelloWorld program. The .cpp file that you
create will be saved in the project folder you just created
<a href="cdt_w_newproj.htm">Creating a project</a>.</p>
<a href="cdt_w_newproj.htm">Creating a Makefile project</a>.</p>
<p>Files are edited in the C/C++ editor located to the right of
the C/C++ Projects view. The left margin of the C/C++ editor, called the marker
@ -22,58 +22,50 @@ bar, displays icons for items such as bookmarks, breakpoints, and compiler erro
<p>For more information about:</p>
<ul>
<li>The marker bar, see <b>Workbench User Guide &gt; Reference &gt; User interface
information &gt; Icons and buttons &gt; Editor area marker bar</b></li>
<li>The editor area, see <b>Workbench User Guide &gt; Reference &gt; User interface
<li>The editor area and marker bar, see <b>Workbench User Guide &gt; Reference &gt; User interface
information &gt; Views and editors &gt; Editor area</b></li>
<li>The marker bar icons, see <b>Workbench User Guide &gt; Reference &gt; User interface
information &gt; Icons and buttons &gt; Editor area marker bar</b></li>
</ul>
<p>To create a C++ file:</p>
<ol>
<li>In the <b>C++ Projects</b> view, right-click the <b>HelloWorld</b> project
folder, and select <b>New &gt; File</b>.</li>
<li>In the <b>File name</b> field, type <b>main.cpp</b>.</li>
<li>In the <b>Project Explorer</b> view, right-click the <b>HelloWorld</b> project
folder, and select <b>New &gt; Source File</b>.</li>
<li>In the <b>Source file: </b> field, type <b>main.cpp</b>.
<br>By default the source folder should be your project folder.
<br>The template selected is probably "Default C/C++ Source Template."
</li>
<li>Click <b>Finish</b>.</li>
<li>Type the code, exactly as it appears below, in the editor. Lines are indented with tab
characters, not with spaces.</li>
<li>A Comment template probably appears at the top of an otherwise empty file.
Type the code, exactly as it appears below, in the editor.
Or you can paste it in from this help file.
</li>
<pre>
#include &lt;iostream&gt;
using namespace std;
int main () {
// Say Hello five times
for (int index = 0; index < 5; ++index)
cout << "HelloWorld!" << endl;
char input = 'i';
cout << "To exit, press 'm'" << endl;
while(input != 'm') {
cin >> input;
cout << "You just entered " << input
<< " you need to enter m to exit." << endl;
}
exit(0);
}
</pre>
<blockquote>
<p>#include &lt;iostream&gt;<br>
using namespace std;<br>
<br>
int main () {<br>
&nbsp;&nbsp;&nbsp;
// Say Hello five times<br>
&nbsp;&nbsp;&nbsp;
for (int index = 0; index &lt; 5; ++index) <br>
&nbsp;&nbsp;&nbsp;
cout &lt;&lt; &quot;HelloWorld!&quot; &lt;&lt; endl;<br>
<br>
&nbsp;&nbsp;&nbsp;
char input = 'i';<br>
<br>
&nbsp;&nbsp;&nbsp;
cout &lt;&lt; &quot;To exit, press 'm'&quot; &lt;&lt; endl;<br>
<br>
&nbsp;&nbsp;&nbsp;
while(input != 'm') {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cin&nbsp; &gt;&gt; input;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cout &lt;&lt; &quot;You just entered &quot; &lt;&lt; input <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; &quot; you need to enter m to exit.&quot; &lt;&lt; endl;<br>
&nbsp;&nbsp;&nbsp;
}<br>
<br>
&nbsp;&nbsp;&nbsp;
exit(0);<br>
}</p>
</blockquote>
<li>Click <b>File &gt;
Save</b>.</li>
</ol>
<p>Your new .cpp file is displayed in the C/C++ Projects
view and in the Navigator view. Your project now contains main.cpp. Before you
<p>Your new .cpp file is displayed in the <b>Project Explorer</b> view. Your project now contains main.cpp. Before you
can build your HelloWorld project, you must create a makefile.</p>
<p>

View file

@ -21,9 +21,8 @@ function newWin(url) {
<p>To create a makefile:</p>
<ol>
<li>In the <b>C++ Projects</b> view, right-click the <b>HelloWorld</b> project
<li>In the <b>Project Explorer</b> view, right-click the <b>HelloWorld</b> project
folder and select <b>New &gt; File</b>.
<p><br><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_newmake01.png')">Click here to see an illustration (displayed in a separate window)</a>.</p><br></li>
<li>In the <b>File name</b> box, type <b>makefile</b>.</li>
<li>Click <b>Finish</b>.</li>
<li>Type the gnu make instructions below in the editor. Lines are
@ -48,9 +47,11 @@ function newWin(url) {
Save</b>.</li></ol>
<p>Your new makefile, along with your main.cpp file are
displayed in the C/C++ Projects view and in the Navigator view. Your project now
displayed in the Project Explorer view. Your project now
contains main.cpp and makefile. You can now build your HelloWorld project.</p>
<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_newmake02.png')">Click here to see an illustration</a>.</p>
<p>NEW <a href="javascript:void(0)" onClick="newWin('../images/cdt_w_newmake02.png')">Click here to see an illustration</a>.</p>
<p>
<a href="cdt_w_build.htm" style="text-decoration: none">

View file

@ -13,8 +13,10 @@ function newWin(url) {
</head>
<body>
<h1>Creating a project</h1>
<h1>Creating a Makefile project</h1>
<p>
This tutorial describes the process of creating a new C++ project that includes a makefile, and debugging the program.</p>
<p>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.</p>
@ -23,7 +25,7 @@ that can incrementally compile source files as they are changed.</p>
<ol>
<li>Select <b>File &gt; New &gt; Project</b>.
<p><br>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.</p><br>
<li>Select the type of project to create. For this tutorial, expand the <b>C++</b> folder and select <b>C++ Project</b>.
<li>Select the type of project to create. For this tutorial, expand the <b>C/C++</b> folder and select <b>C++ Project</b>.
<br><p>The <b>C++ Project</b> wizard opens. <a href="javascript:void(0)" onClick="newWin('../images/cdt_w_basic19.png')">Click here to see an illustration.</a></p><br>
<p>By default, the CDT filters the <b>Toolchain</b> and <b>Project types</b> that currently display in those lists are based on the language support for the C++ Project wizard you selected for this tutorial.</p><br>
<li>In the <b>Project name</b> field, type HelloWorld.
@ -33,10 +35,13 @@ that can incrementally compile source files as they are changed.</p>
<li><b>Executable</b> - Provides an executable application. This project type folder contains three templates.</p>
<ul>
<li><b>Hello World C++ Example</b> provides a simple C++ Hello World application with main().
<li><b>Hello World ANSI C Example</b> provides a simple C Hello World application with main().<li><b>Empty Project</b> provides a single source project folder that contains no files.
</ul>
<p>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.</p><p>The makefile for the <b>Executable</b> project type is automatically created by the CDT.</p>
<li><b>Hello World ANSI C Example</b> provides a simple C Hello World application with main().
<li><b>Empty Project</b> provides a single source project folder that contains no files.
<p>After you select this template, the result is a project with only the meta-data files required for the project type.
You are expected to provide source files for the project's target.</p>
</ul>
<p>The makefile for the <b>Executable</b> project type is automatically created by the CDT.</p>
<p>&nbsp;</p>
<li><b>Shared Library</b> - 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.<var>version</var>, where
<var>version</var> is a number with a default of 1. The
@ -47,41 +52,52 @@ into an archive (*.a) that is directly linked into an
executable. The makefile for this project type is automatically created by the CDT.
<li><b>Makefile Project</b> - 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.
</ul>
<p>By default, the CDT filters the <b>Toolchain</b> and <b>Project types</b> that currently display in those lists based on the language support for the C++ Project wizard you selected for this tutorial.
<li>From the <b>Project types</b> list, expand <b>Executable</b> and select <b>Hello World C++ Example</b>. This project type provides a simple Hello World application in C++, and the makefile is automatically created by the CDT.
<p>&nbsp;</p>
<li>From the <b>Project types</b> list, expand <b>Makefile project</b> and select <b>Empty Project</b>.
This project lets you enter the source file and the makefile yourself.
<li>Select a required toolchain from the <b>Toolchain</b> list.
<p>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.<br>
There can be several toolchains available, depending on the compilers installed on your system.
</p>
</li>
<li>Click <b>Next</b>.</li>
<li>Click <b>Advanced Settings</b>.
<li>Click the <b>Binary Parser</b> tab.
<li>Click <b>Next</b>.
<li>(Optional) On the <b>Select Configurations</b> page, Click <b>Advanced Settings</b>.
<ul>
<li>Expand <b>C/C++Build > Settings</b>. Click the <b>Binary Parsers</b> tab.
<p><br><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_binparser01.png')">Click here to see an illustration.</a></p><br>
</p>
</li>
<li>In the <b>Binary Parser</b> list, select <b>PE Windows Parser</b>.</li>
<li>In the <b>Binary Parser</b> list, select the error parser that is appropriate for your platform.
Other project settings can be modified here as well. The default selection is probably OK.
</li>
<p>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.
<p></p>Click <b>OK</b> to close the Project Properties window.
</ul>
</p>
<li>Click <b>Finish</b>.</li>
<li>If a message box prompts you to change perspectives, click <b>Yes</b>.
</li>
</ol>
<p>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
<p>Your new project displays in the Project Explorer view.
Your project is empty because you have not yet created
files for your project.
You may see an error since there is nothing to build yet for your project.
You can now start writing the code for your HelloWorld
program.</p>
<p><b>Tip:</b> You can view and modify the properties of your
HelloWorld project by right-clicking on the project in the C/C++ Projects
HelloWorld project at any time by right-clicking on the project in the <b>Project Explorer</b>
view and clicking Properties.</p> <p><a style="text-decoration: none" href="cdt_w_newcpp.htm"><img
src="../images/ngnext.gif" height="16" width="16" border="0" alt="Next Icon"></a> <a href="cdt_w_newcpp.htm"><b>
Next: Creating your C++ file</b></a></p> <p align="left">For more information

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View file

@ -3,10 +3,10 @@
<toc label="Getting Started">
<topic label="Preparing the Workbench" href="getting_started/cdt_w_prepare_workbench.htm"/>
<topic label="Creating a simple application" href="getting_started/cdt_w_basic.htm"/>
<topic label="Creating a project" href="getting_started/cdt_w_newproj.htm"/>
<topic label="Creating a Makefile project" href="getting_started/cdt_w_newproj.htm"/>
<topic label="Importing an existing project" href="getting_started/cdt_w_import.htm"/>
<topic label="Building a project" href="getting_started/cdt_w_build.htm"/>
<topic label="Debugging projects" href="getting_started/cdt_w_debug.htm"/>
<topic label="Importing C/C++ source files into Eclipse" href="getting_started/cdt_w_existing_code.htm"/>
<!--topic label="Updating the CDT" href="getting_started/cdt_w_install_cdt.htm"/-->
</toc>
</toc>