carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/309/1/.cp/getting_started/cdt_w_newproj.htm
changeset 5 684bf18fdedf
equal deleted inserted replaced
4:4764c8c88759 5:684bf18fdedf
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
       
     2 <html lang="en">
       
     3 <head>
       
     4 	<meta http-equiv="content-language" content="en-us">
       
     5 	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
       
     6 	<title>Creating your project</title>
       
     7 	<link href="../help.css" type="text/css" rel="stylesheet">
       
     8 <script language="JavaScript">
       
     9 function newWin(url) {
       
    10 	window.open(url, 'install_cdt', 'width=750, height=700, menubar=no, toolbar=no, status=no, resizable=yes, location=no, scrollbars=yes');
       
    11 }
       
    12 </script>
       
    13 </head>
       
    14 <body> 
       
    15 
       
    16 <h1>Creating a Makefile project</h1>  
       
    17 
       
    18 <p>
       
    19 This tutorial describes the process of creating a new C++ project that includes a makefile, and debugging the program.</p>
       
    20 <p>You need to create a project to contain your source code and related files. A  project has an associated builder
       
    21 that can incrementally compile source files as  they are changed.</p> 
       
    22 
       
    23 <p>To create a project:</p> 
       
    24 
       
    25 <ol>
       
    26 	<li>Select <b>File &gt; New &gt; Project</b>.
       
    27 <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>
       
    28 <li>Select the type of project to create. For this tutorial, expand the <b>C/C++</b> folder and select <b>C++ Project</b>.
       
    29 	<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>
       
    30 <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>
       
    31 <li>In the <b>Project name</b> field, type HelloWorld.
       
    32 <li>Leave the <b>Use Default Location</b> option selected.  
       
    33 	<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>
       
    34 	<ul>
       
    35 	<li><b>Executable</b> - Provides an executable application. This project type folder contains three templates.</p>
       
    36 	<ul>
       
    37 	<li><b>Hello World C++ Example</b> provides a simple C++ Hello World application with main().
       
    38 	<li><b>Hello World ANSI C Example</b> provides a simple C Hello World application with main().
       
    39 	<li><b>Empty Project</b> provides a single source project folder that contains no files.
       
    40 	<p>After you select this template, the result is a project with only the meta-data files required for the project type. 
       
    41 	You are expected to  provide source files for the project's target.</p>
       
    42 	</ul>
       
    43 	<p>The makefile for the <b>Executable</b> project type is automatically created by the CDT.</p>
       
    44 <p>&nbsp;</p>
       
    45 		<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
       
    46  libxx.so.<var>version</var>, where
       
    47 <var>version</var> is a number with a default of 1. The
       
    48 libxx.so file usually is a symbolic link to the
       
    49 latest version. The makefile for this project type is automatically created by the CDT.
       
    50 		<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)
       
    51 into an archive (*.a) that is directly linked into an
       
    52 executable. The makefile for this project type is automatically created by the CDT.
       
    53 		<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. 
       
    54 	</ul> 
       
    55 	
       
    56 <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.
       
    57 <p>&nbsp;</p>
       
    58 <li>From the <b>Project types</b> list, expand <b>Makefile project</b> and select <b>Empty Project</b>. 
       
    59 This project lets you enter the source file and the makefile yourself.
       
    60 
       
    61 <li>Select a required toolchain from the <b>Toolchain</b> list. 
       
    62 <p>A toolchain is a set of tools (such as a compiler, linker, and assembler) intended to build your project.
       
    63 Additional tools, such as a debugger, can be associated with a toolchain.<br>
       
    64 There can be several toolchains available, depending on the compilers installed on your system.
       
    65 </p>
       
    66 
       
    67 </li>
       
    68 <li>Click <b>Next</b>.
       
    69 <li>(Optional) On the <b>Select Configurations</b> page, Click <b>Advanced Settings</b>.
       
    70 <ul> 
       
    71 <li>Expand <b>C/C++Build > Settings</b>. Click the <b>Binary Parsers</b> tab.
       
    72 <p><br><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_binparser01.png')">Click here to see an illustration.</a></p><br>
       
    73 </p>
       
    74 </li>
       
    75 <li>In the <b>Binary Parser</b> list, select the error parser that is appropriate for your platform.
       
    76 Other project settings can be modified here as well.  The default selection is probably OK.
       
    77 
       
    78 </li>
       
    79 <p>To ensure the accuracy of the C/C++  Projects view and the ability to successfully
       
    80 run and debug your programs, selecting the correct parser is important. After
       
    81 you select the correct parser for your development environment and build your
       
    82  project, you can view the components of the .o file in the C/C++ Projects
       
    83 view. You can also view the contents of the .o file in the C/C++ editor.
       
    84 <p></p>Click <b>OK</b> to close the Project Properties window.
       
    85 </ul>
       
    86 </p>
       
    87 <li>Click <b>Finish</b>.</li>
       
    88 <li>If a message box prompts you to change perspectives, click <b>Yes</b>.
       
    89 </li>
       
    90 </ol>  
       
    91 
       
    92 <p>Your new project displays in the Project Explorer view. 
       
    93 Your project is empty because you have not yet created
       
    94 files for your project. 
       
    95 You may see an error since there is nothing to build yet for your project.
       
    96 You can now start writing the code for your HelloWorld
       
    97 program.</p>  
       
    98 
       
    99 <p><b>Tip:</b> You can view and modify the properties of your
       
   100 HelloWorld project at any time by right-clicking on the project in the <b>Project Explorer</b> 
       
   101 view and clicking Properties.</p>  <p><a style="text-decoration: none" href="cdt_w_newcpp.htm"><img
       
   102 src="../images/ngnext.gif" height="16" width="16" border="0" alt="Next Icon"></a> <a href="cdt_w_newcpp.htm"><b>
       
   103 Next: Creating your C++ file</b></a></p>  <p align="left">For more information
       
   104 about:</p>  <ul>
       
   105 <li>Projects, see <b>Workbench User Guide > Concepts > Workbench  > Resources
       
   106 </b></li>
       
   107 <li>The workspace, see <b>Workbench User Guide  > Tasks > Upgrading Eclipse
       
   108 </b></li>
       
   109 </ul>  <p><img src="../images/ngconcepts.gif" alt="Related concepts" height="21" width="143"
       
   110 border="0"> <br> <a href="../concepts/cdt_c_over_cdt.htm">CDT overview</a><br> <a href="../concepts/cdt_c_projects.htm">
       
   111 CDT projects</a><br> <a href="../concepts/cdt_c_proj_file_views.htm">Project file views
       
   112 </a></p> <p><img src="../images/ngtasks.gif" alt="Related tasks" height="21" width="143"
       
   113 border="0"> <br> <a href="../tasks/cdt_o_proj_files.htm">Working with C/C++ project files</a></p> <p><img
       
   114 src="../images/ngref.gif" alt="Related reference" height="21" width="143" border="0"> <br> <a
       
   115 href="../reference/cdt_o_proj_prop_pages.htm">C/C++ Projects view</a></p>  
       
   116 
       
   117 <p><img src="../images/ng00_04a.gif" ALT="QNX Copyright Statement" ></p>
       
   118 
       
   119 </body>
       
   120 </html>