blob: cb364e3f12b613de0c613275198e6f264ed71704 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.ord/TR/html4/loose.dtd">
<html>
<head>
<title>Common Wizards</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<hr>
<h1><a name="id1">Common Wizards</a></h1>
<p>
</p>
<p></p>
In this chapter:
<ul>
<li><a href="#how">Introduction</a>
</li>
<li><a href="#c">Creating a C/C++ Project (New Project wizard)</a>
</li>
<li><a href="#convert">Converting projects (Convert to a QNX Project wizard)</a></li>
</ul>
<p></p>
<h1><a name="how">Introduction</a></h1>
<p>Wizards guide you through a sequenced set of tasks. In the IDE, these tasks may
be creating something new (e.g. a project) or converting one thing to another
(e.g. converting to a Standard C project). Most often, you use wizards to create
new projects and folders.</p>
<p>
Wizards aren't directly connected to any perspective, though you're more likely to call them from some perspectives than from others (most likely from the <b>C/C++ Development</b> perspective).</p>
<p>You can access all the wizards from the main menu by selecting <b>File</b>--><b>New</b>. The <b>File</b>--><b>New</b>--><b>Project</b> selection filters out all the wizards except projects; <b>File</b>--><b>New</b>--><b>Other</b> doesn't filter anything. (The exception to this is <b>Target System Project</b>, which, while labeled as a project, isn't a project as far as the IDE is concerned.)</p>
<p>In the <b>New Project</b> dialog, the wizards are further sorted: selecting <b>C</b> in the left pane displays all the projects with a C nature in the IDE; selecting <b>QNX</b> in the left pane shows all the projects with a QNX nature:</p>
<p><img src="./images/cwiz.jpg" alt="Common wizards dialog"></p>
<p> Notice the overlap: the <b>QNX C Application Project</b> wizard appears in the right pane for both <b>C</b> and <b>QNX</b>.</p>
<p>
So-called "simple" wizards show the very basic elements of projects: <b>Project</b>, <b>Folder</b>, and <b>File</b>. These elements have no natures associated with them. You can access the wizards for these by selecting <b>File</b>--><b>New</b>--><b>Other</b>, then selecting <b>Simple</b> from the left pane.</p>
<p></p>
<hr>
<table>
<tr><td valign="top"><img src="image-lib/pointing.gif" alt="Note:"></td>
<td><p>Although projects may appear as directories in your workspace, the IDE attaches special meaning to them. The IDE won't automatically recognize a directory you create in your <tt>workspace</tt> directory as a project.</p><p>
The IDE automatically recognizes directories and new files of any type if you create them outside of the IDE (i.e. using Windows Explorer) and place them in a project directory. To have the IDE recognize them, in the <b>Navigator</b> view, right-click the navigator pane and select <b>Refresh</b>. </p></td></tr>
</table>
<hr>
<h1><a name="c">Creating a C/C++ project (New Project wizard)</a></h1>
<p>The <b>New Project</b> wizard helps you create a C or C++ project.</p>
<p>This section includes:</p>
<ul>
<li><a href="#c_types">Types of projects</a>
</li>
<li><a href="#c_creating">Creating your C/C++ Project (New Projects wizard)</a>
</li>
<li><a href="#c_tabs">New C/C++ Project wizard tabs</a> </li>
</ul>
<h2><a name="c_types">Types of projects</a></h2>
<p>The IDE lets you create a variety of projects, each with certain properties. Most of these projects are also subdivided into C or C++ projects:
</p>
<dl>
<dt><b>Standard Make C Project</b><br><b>Standard Make C++ Project</b>
</dt>
<dd>A basic C or C++ project that uses a standard <tt>makefile</tt> and GNU <tt>make</tt> to build the source files. You don't get the added functionality provided by the QNX build organization and the <tt>common.mk</tt> file.
</dd>
</dl>
<h2><a name="c_creating">Creating your C/C++ project (New Projects wizard)</a></h2>
<p>To create a C/C++ project :
</p>
<ol>
<li>From the menu, select <b>File</b>--><b>New</b>--><b>Project</b>.
The <b>New</b> dialog appears. Projects are filtered by the natures listed in the left pane.
</li>
<li>In the left pane, select the nature in the table:<p></p><table border=1 width="100%">
<tr>
<th>If you want to build:
</th>
<th>Select:</th>
</tr>
<tr>
<td><b>Standard Make C Application Project</b>
</td>
<td><b>C</b></td>
</tr>
<tr>
<td><b>QNX C Application Project</b>
</td>
<td><b>C</b> or <b>QNX</b></td>
</tr>
<tr>
<td><b>QNX C Library Project</b>
</td>
<td><b>C</b> or <b>QNX</b></td>
</tr>
<tr>
<td><b>Standard Make C++ Application Project</b>
</td>
<td><b>C++</b></td>
</tr>
<tr>
<td><b>QNX C++ Application Project</b>
</td>
<td><b>C++</b> or <b>QNX</b></td>
</tr>
<tr>
<td><b>QNX C++ Library Project</b>
</td>
<td><b>C++</b> or <b>QNX</b></td>
</tr>
</table>
</li>
<li>In the right pane, select the type of project that you want (e.g. <b>QNX C Application Project</b>).
</li>
<li>Click <b>Next</b>.
</li>
<li>Type a name for your project in the <b>Name</b> field.
</li>
<li>Ensure that <b>Use Default Location</b> is checked. Don't use a different location.
</li>
<li>Click <b>Next</b>.
The wizard displays the appropriate tabs.
</li>
<li>Select each tab and fill in the required information. The fields for each tab are described in the <a href="#c_tabs">"New C/C++ Project wizard tabs"</a> section, below.
</li>
<li>Click <b>Finish</b>.
The IDE creates your new project in your workspace. </li>
</ol>
<hr>
<table>
<tr><td valign="top"><img src="image-lib/pointing.gif" alt="Note:"></td>
<td>In the <b>C/C++ Development</b> perspective, you can also access the <b>QNX C/C++ Projects</b> with the
<img src="./images/icon_newccqnx_lib.gif" alt="Icon: QNX C++ Library Project"> &nbsp;
<img src="./images/icon_newcqnx_lib.gif" alt="Icon: QNX C Library Project">&nbsp;
<img src="./images/icon_newccqnx_app.gif" alt="Icon: QNX C++ Application Project">&nbsp;
<img src="./images/icon_newcqnx_app.gif" alt="Icon: QNX C Application Project">&nbsp;
buttons.
</td></tr>
</table>
<hr>
<h2><a name="c_tabs">New C/C++ Project wizard tabs</a></h2>
<p>Depending on the type of project you choose, the <b>New Project</b> wizard displays different tabs:
</p>
<table border=1 width="100%">
<tr>
<th>Project Type
</th>
<th>Architecture tab,<br>Options tab
</th>
<th>Projects tab,<br>Build Settings tab
</th>
<th>Library tab
</th>
</tr>
<tr>
<td><b>Standard Make C Project</b> or<br><b>Standard Make C++ Project</b>
</td>
<td>Yes
</td>
<td>No
</td>
<td>No
</td>
</tr>
<tr>
<td><b>QNX C Application Project</b> or<br><b>QNX C++ Application Project</b>
</td>
<td>Yes
</td>
<td>Yes
</td>
<td>No
</td>
</tr>
<tr>
<td><b>QNX C Library Project</b> or<br><b>QNX C++ Library Project</b>
</td>
<td>Yes
</td>
<td>Yes
</td>
<td>Yes
</td>
</tr>
</table>
<hr>
<table>
<tr><td valign="top"><img src="image-lib/pointing.gif" alt="Note:"></td>
<td> You can find the default settings for the <b>New Project</b> wizard by selecting <b>Window</b>--><b>Preferences</b> from the main menu. From the left pane, select <b>C/C++</b>, then <b>New QNX Projects</b>.</td></tr>
</table>
<hr>
<h3><a name="id8">Architecture tab</a></h3>
<p>The <b>Architecture</b> tab lets you choose the platforms to compile executables for:</p>
<p><img src="./images/cwiz_c_architecture.jpg" alt="Common wizards: C/C++ Projects; Architecture tab"></p>
<p>For example, to build for a PowerPC platform, enable <b>PPC (Big Endian)</b>.</p>
<p>
If you've already created a <b>QNX Target System Project</b>, you'll also see entries such as <b>Doug [localhost - x 86]</b>. These let you build specifically for a configured target. If you also enable <b>X86 (Little Endian)</b>, the IDE builds only one executable, not two.</p>
<p>
You must choose at least one platform.
</p>
<h3><a name="id10">Projects tab</a></h3>
<p>The <b>Projects</b> tab lets you configure your preferred order of building:</p>
<p><img src="./images/cwiz_c_projects.jpg" alt="Common wizards: C/C++ Projects; Projects tab"></p>
<p>For example, if you associate <i>myProject</i> with <i>mySubProject</i>, the IDE builds <i>mySubProject</i> first during rebuilds. If you change <i>mySubProject</i>, the IDE doesn't automatically rebuild <i>myProject</i>.
</p>
<h3><a name="id12">Build Settings tab</a></h3>
<p>The <b>Build Settings</b> tab lets you configure how the IDE handles <tt>make</tt> errors and what command to use to build your project:</p>
<p><img src="./images/cwiz_c_buildsettings.jpg" alt="Common wizards: C/C++ Projects; Build Settings tab ">
</p>
<dl>
<dt><b>Build Settings</b></dt>
<dd>If you want the IDE to stop building when it encounters a <tt>make</tt> error, enable <b>Stop on Error</b>. Otherwise, enable <b>Keep Going On Error</b>.
</dd>
<dt><b>Build Command</b></dt>
<dd>If you want the IDE to use the default <tt>make</tt> command, enable <b>Use Default</b>. If you want to use a different utility to build your project, disable <b>Use Default</b> and enter your own command in the <b>Build Command</b> field (e.g. <tt>C:\<i>myCustomizedMakeProgram</i></tt>).
</dd>
</dl>
<h3><a name="id14">Options tab</a></h3>
<p>The <b>Options</b> tab lets you choose what type of executables the IDE builds:</p>
<p><img src="./images/cwiz_c_options.jpg" alt="Common wizards: C/C++ Projects; Options tab">
</p>
<dl>
<dt><b>Build Type</b></dt>
<dd>To build a regular executable, enable <b>Build release version</b>. To build a debuggable executable, enable <b>Build debug version</b> (debug versions have <tt>_g</tt> appended to their filename).
<p>
You must select at least one build type.
</p></dd>
<dt><b>Build Options</b></dt>
<dd>To fully enable profiling with the <b>QNX Application Profiler</b> perspective, enable <b>Build with Profiling</b>. The IDE adds profiling code to all the versions selected in <b>Build Types</b>. See the <a href="prof.html">Profiling Your Application</a> chapter.</dd>
</dl>
<h3><a name="id16">Library tab</a></h3>
<p>The <b>Library</b> tab lets you choose the type of library you wish to build (e.g. <b>Static library</b>, <b>Shared library</b>):</p>
<p><img src="./images/cwiz_c_library.jpg" alt="Common wizards: C/C++ Projects; Library tab"></p>
<dl>
<dt>Static library (<tt>libxx.a</tt>)
</dt>
<dd>Combine binary object files (i.e. <tt>*.o</tt>) into an archive that will later be directly linked into an executable.
</dd>
<dt>Shared library (<tt>libxx.so</tt>)
</dt>
<dd>Combine binary objects together and join them so they are relocatable and can be shared by many processes. Shared libraries are named using the format <tt>libxx.so.</tt><i>version</i>, where <i>version</i> is a number with a default of 1. The <tt>libxx.so</tt> file symlinks to the latest version.
</dd>
<dt>Static library for shared objects (<tt>libxxS.a</tt>)
</dt>
<dd>Same as static library, but using position-independent code (PIC). Use this for a library that will later be linked into a shared object. The System Builder uses these types of libraries to create new shared libraries that contain only the symbols that are absolutely required by a specific set of programs.
</dd>
<dt>Shared library without export (<tt>xx.so</tt>)
</dt>
<dd>A shared library without versioning. Generally, you manually open the library with the <a href="../../neutrino/lib_ref/d/dlopen.html"><i>dlopen()</i></a> function and look up specific functions with the <a href="../../neutrino/lib_ref/d/dlsym.html"><i>dlsym()</i></a> function.</dd>
</dl>
<p>You must choose one of the options.
</p>
<h1><a name="target">Creating a target (New Target System Project wizard)</a></h1>
<p>You must create a <b>Target System Project</b> for every target you have. When you create a launch configuration, you have the option of adding a new target from within the <b>Launch Configurations</b> dialog. When you do, the IDE opens up the <b>New Target System Project</b> wizard.</p>
<p>
To create a new target:</p>
<ol>
<li>From the menu, select <b>File</b>--><b>New</b>--><b>Other</b>.
</li>
<li>In the left pane, select <b>QNX</b>.
</li>
<li>In the right pane, select <b>QNX Target System Project</b>.
</li>
<li>Click <b>Next</b>.
The <b>New QNX Target System Project</b> wizard appears:<p>
<img src="./images/cwiz_target.jpg" alt="Common wizards: New Target System Project">
</p></li>
<li>Fill in the fields described below:
<dl>
<dt><b>Target Name</b>
</dt>
<dd>Type a descriptive name for your <b>QNX Target System Project</b>.
</dd>
<dt><b>Project contents</b>
</dt>
<dd>Enable <b>Use default</b> to store it in your workspace, or disable it and select another location in the <b>Directory</b> field.
</dd>
<dt><b>QNX Connector Selection</b>
</dt>
<dd>Type the target connection in the <b>Hostname or IP</b> and <b>Port</b> fields. If you're running the IDE on a QNX Neutrino machine running <tt>qconn</tt>, make sure <b>Use local QNX Connector</b> is enabled; the IDE automatically fills in the connection information. (If you wish to connect to a different target, you may disable <b>Use local QNX Connector</b> and fill in the fields manually.)
</dd>
<dt><b>Target Configuration</b>
</dt>
<dd>This section is for a future feature.
</dd>
</dl>
</li>
<li>Click <b>Finish</b>.
Your new <b>QNX Target System Project</b> appears in the <b>Navigator</b> view. When you create a <b>Launch Configuration</b>, the target is listed under the <b>Main</b> tab in the <b>Target Options</b> pane.
<hr>
<table>
<tr><td valign="top"><img src="image-lib/pointing.gif" alt="Note:"></td>
<td>You can also reach the <b>New Target System Project</b> wizard by right-clicking in the <b>Target Options</b> pane and selecting <b>Add target</b>.</td></tr>
</table>
<hr>
</li>
</ol>
<h1><a name="convert">Converting projects (Convert to a QNX Project wizard)</a></h1>
<p>At various times, you may want to convert projects to give them a QNX nature. For example:</p>
<ul>
<li>if other developers committed a project to CVS without the <tt>.project</tt> and <tt>.cdtproject</tt> files, the IDE won't recognize the project as a <b>QNX</b> project when you get it from CVS
</li>
<li>you wish to turn a <b>Standard Make C/C++ Project</b> into a <b>QNX C/C++ Application Project</b>.</li>
</ul>
<p>The QNX nature causes the IDE to use QNX <tt>make</tt> tools and the QNX <tt>make</tt> structure when building them.</p>
<p></p>
<p>The IDE lets you convert many projects in the same step, but the projects are all converted into projects of the same type.</p>
<p></p>
<hr>
<table>
<tr><td valign="top"><img src="image-lib/pointing.gif" alt="Note:"></td>
<td>If you wish to convert a <b>QNX Project</b> back into a <b>Standard Make C/C++ Project</b>, you can use the <b>Convert C/C++ Projects</b> wizard. From the main menu, select <b>File</b>--><b>New</b>--><b>Project</b>. In the left pane, select <b>C</b>. In the right pane, select <b>Convert to a C or C++ Project</b>.</td></tr>
</table>
<hr>
<p>
To convert to a <b>QNX Project</b>:</p>
<ol>
<li>From the menu, select <b>File</b>--><b>New</b>--><b>Project</b>.
</li>
<li>In the left pane, select <b>QNX</b>.
</li>
<li>In the right pane, select <b>Convert to a QNX Project</b>:<p> <img src="./images/cwiz_convert_1.jpg" alt="Common wizards: Convert to a QNX Project; selecting wizard">
</p></li>
<li>Click <b>Next</b>.
</li>
<li>Fill in the fields described below:
<p>The fields let you to convert a selection of projects to one of the following types of projects:</p><ul>
<li><b>QNX C Application Project</b>
</li>
<li><b>QNX C Library Project</b>
</li>
<li><b>QNX C++ Application Project</b>
</li>
<li><b>QNX C++ Library Project</b></li>
</ul>
<dl>
<dt><b>Candidates for conversion</b></dt>
<dd>The IDE lists all the projects that can be converted. Check off all the projects you wish to convert.
</dd>
<dt><b>Convert to C or C++</b></dt>
<dd>Select whether your projects are C or C++.
</dd>
<dt><b>Convert to QNX project type</b></dt>
<dd>Select <b>QNX Application Project</b> or <b>QNX Library Project</b>, depending on whether or not your projects are applications or libraries.</dd>
</dl>
</li>
<li>Click <b>Finish</b>.</li>
</ol>
</body>
</html>
<!--
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems Ltd. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
-->