Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 24c3dbda0d6b82ad3181881f4f3270648a091a22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html lang="en">
<head>
	<meta http-equiv="content-language" content="en-us">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<title>Creating your project</title>
	<link href="../help.css" type="text/css" rel="stylesheet">
<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>Creating a project</h1>  

<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> 

<p>To create a project:</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>.
	<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.
<li>Leave the <b>Use Default Location</b> option selected.  
	<p><br>Next, you want to select the type of project to create. In the New CDT Project Wizard, you can choose from the following project types:</p>
	<ul>
	<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>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
libxx.so file usually is a symbolic link to the
latest version. The makefile for this project type is automatically created by the CDT.
		<li><b>Static Library</b> - A collection of object files that you can link into another application (libxx.a). The CDT combines object files (i.e. *.o)
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.

<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.
<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>
<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>
<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
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
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
about:</p>  <ul>
<li>Projects, see <b>Workbench User Guide > Concepts > Workbench  > Resources
</b></li>
<li>The workspace, see <b>Workbench User Guide  > Tasks > Upgrading Eclipse
</b></li>
</ul>  <p><img src="../images/ngconcepts.gif" alt="Related concepts" height="21" width="143"
border="0"> <br> <a href="../concepts/cdt_c_over_cdt.htm">CDT overview</a><br> <a href="../concepts/cdt_c_projects.htm">
CDT projects</a><br> <a href="../concepts/cdt_c_proj_file_views.htm">Project file views
</a></p> <p><img src="../images/ngtasks.gif" alt="Related tasks" height="21" width="143"
border="0"> <br> <a href="../tasks/cdt_o_proj_files.htm">Working with C/C++ project files</a></p> <p><img
src="../images/ngref.gif" alt="Related reference" height="21" width="143" border="0"> <br> <a
href="../reference/cdt_o_proj_prop_pages.htm">C/C++ Projects view</a></p>  

<p><img src="../images/ng00_04a.gif" ALT="QNX Copyright Statement" ></p>

</body>
</html>

Back to the top