carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/309/1/.cp/getting_started/cdt_w_import.htm
author cawthron
Fri, 04 Dec 2009 10:01:33 -0600
changeset 5 684bf18fdedf
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     2
<html lang="en">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     3
<head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     4
	<meta http-equiv="Content-Language" content="en-us">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     5
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     6
	<title>CDT Importing an Existing Managed Make Project Tutorial</title>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     7
	<link rel="stylesheet" type="text/css" href="../help.css">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     8
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     9
<script language="JavaScript">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    10
function newWin(url) {
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    11
	window.open(url, 'install_cdt', 'width=950, height=700, menubar=no, toolbar=no, status=no, resizable=yes, location=no, scrollbars=yes');
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    12
}
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    13
</script>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    14
</head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    15
<body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    16
<h2>Tutorial: Importing an existing project</h2>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    17
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    18
<p>The following tutorial takes you though the process of importing a 'legacy' application using the CDT.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    19
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    20
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    21
<p>Step 1: You want to create a single project that will reflect all of the components for the existing source tree.<br></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    22
<ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    23
	<li>Select <b>File &gt; New &gt; Project</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    24
	<li>For this tutorial, expand <b>C/C++</b> and select <b>C++ project</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    25
	<p><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    26
	The <b>New Project</b> wizard displays. 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    27
	<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_import02.png')">Click
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    28
	here to see an illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    29
	<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    30
	<li>In the <b>Project name</b> field, type a name for the project.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    31
	<li>Ensure that the <b>Use default location</b> option is not selected because here we will specify where the
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    32
	resources reside in the file system, in a location other than your workspace. <br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    33
	We assume this directory location already exists, and contains e.g. source files and makefile. If it does not exist, it
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    34
	will be created.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    35
	<p>In this example, we will use an existing <code>hello.cpp</code> and its 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    36
	existing <code>hello.mak</code>  makefile, located in the directory <code>c:\brandon</code>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    37
	<p>&nbsp;
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    38
		<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon01.png')">Click
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    39
	here to see an illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    40
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    41
	</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    42
	<li>In the <b>Location</b> field, specify the path to the existing files for your project.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    43
	<li>From the <b>Project types</b> list, expand <b>Makefile Project</b> and select <b>Empty Project.</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    44
	<ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    45
		<li>To have sample source and a makefile created in your existing directory, select <b>Hello World C++ Project</b</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    46
	</ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    47
	<li>Make sure a toolchain is selected.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    48
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    49
	<li>Click <b>Next</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    50
	<p>&nbsp;
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    51
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    52
	<li>(Optional) On the <b>Select Configurations</b> page, select only the configurations you want created. Configurations
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    53
	display for each toolchain selected on the previous page of the wizard.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    54
	<li>Click <b>Finish</b> to close the dialog box.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    55
	<p>You will see the new project in the Project Explorer view. In addition, new 'dot' files have been created in
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    56
	your legacy project's root directory, these are CDT project files.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    57
	<ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    58
		<li>(Optional) To see these "hidden" files, open the view menu on the Project explorer view, and select
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    59
		"Customize View." <br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    60
		The view menu is activated via the small downward-pointing triangle in the upper right of the toolbar of the view.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    61
		<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_viewMenu.png')">Click here to see an
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    62
		illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    63
		<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    64
		<li>In the <b>Available Customizations</b> window, on the <b>Filters</b> tab, uncheck ".* resources."
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    65
		<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_viewMenuFilters.png')">Click here to see an
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    66
		illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    67
		<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    68
		<li>The formerly hidden 'dot' files are now shown in the <b>Project Explorer</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    69
		<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_viewMenuFilters2.png')">Click here to see an
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    70
		illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    71
		<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    72
		</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    73
		<li>Hit <b>OK</b> to close the dialog.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    74
	</ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    75
</ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    76
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    77
<p>Step 2: You are now ready to build your project.<br></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    78
<ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    79
	<li>To build your project, select <b>Project</b> &gt; <b>Build Project</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    80
	<br>You can also hit the hammer icon <img src="../images/hammer-icon.png"> on the toolbar to
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    81
	build the selected project.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    82
	<br>&nbsp;</br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    83
	<li>You may see an error e.g. <code> "make: *** no rule to make target 'all'.</code>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    84
	<p>This is because, in our case, we didn't tell it where the makefile is, or its name.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    85
	<ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    86
	<li>Open the project properties (right mouse on project name in the <b>Project Explorer</b> view
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    87
	and select <b>Properties</b> at the bottom on the context menu).</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    88
	<li>On the C/C++ Build Page, on its <b>Builder Settings</b> tab, uncheck "Use default build command"
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    89
	and change the <code>make</code> command to <code>make -f hello.mak</code>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    90
	since our makefile is not named the default <code>makefile</code>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    91
	<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon02.png')">Click
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    92
	here to see an illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    93
	</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    94
	<li>Click <b>OK</b> to close the <b>Project Properties</b> window.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    95
	</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    96
	<li>Your project will probably rebuild.  If not you can force a build via 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    97
	<b>Project</b> &gt; <b>Build Project</b>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    98
	or use the hammer icon <img src="../images/hammer-icon.png">.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    99
	</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   100
	</ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   101
	</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   102
<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>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   103
	<p>&nbsp;
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   104
		<a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon03.png')">Click
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   105
	here to see an illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   106
	<li>Review the results to ensure that there are no errors.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   107
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   108
<p>&nbsp;
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   109
<p></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   110
<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.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   111
<br>To change indexer settings, bring up the Indexer page in the Project Properties.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   112
<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>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   113
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   114
</br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   115
</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   116
</ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   117
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   118
<p>Step 3: You are now ready to run your application.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   119
<ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   120
	<li>To run your application within the C/C++ Perspective, click <b>Run &gt; Run Configurations...</b><p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   121
	    <p>The <b>Run Configurations</b> dialog displays.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   122
	<li>To create a run configuration, select <b>C/C++ Application</b> and click the <b>New</b> icon.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   123
<li>Give your run configuration a name by entering a new name in the <b>Name</b> field at the top.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   124
<li>On the <b>Main</b> tab, select the project by clicking <b>Browse</b> opposite the <b>Project</b> field.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   125
	<ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   126
		<li>From the Project Selection window, select the project and click <b>OK</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   127
	</ul><li>Select the new <b>C/C++ Application</b> you want to execute by clicking <b>Search</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   128
<p>In our case it didn't find the file because it's in a nonstandard location.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   129
Use the <b>Browse</b> button to select the executable.  In our case also it's a nonstandard
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   130
name, <code>hello.e</code> because that's what our makefile <code>hello.mak</code> built.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   131
	<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon04run.png')">Click
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   132
	here to see an illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   133
<ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   134
  <li>If you see the error "[Debugger]: No debugger available", select the Debugger tab
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   135
  and choose a valid debugger for your platform (e.g. gdb/mi).
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   136
  </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   137
  </ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   138
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   139
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   140
<li>Click <b>Run</b> to save the run configuration and run it.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   141
	<p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_importBrandon04run2.png')">Click
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   142
	here to see an illustration (displayed in a separate window)</a>.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   143
<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>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   144
</ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   145
<img src="../images/ng00_04a.gif" ALT="QNX Copyright Statement" >
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   146
</body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
   147
</html>