Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_basic.htm')
-rw-r--r--doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_basic.htm77
1 files changed, 30 insertions, 47 deletions
diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_basic.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_basic.htm
index 5e2ec1e052..7914bc4981 100644
--- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_basic.htm
+++ b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_basic.htm
@@ -35,7 +35,7 @@ With CDT 4.0, you now select a project type, and that determines what build syst
<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>
</li><br>
- <li><p>In the <b>Project name</b> field, type a name for the project.</p>
+ <li><p>In the <b>Project name</b> field, type a name for the project, such as <b>Hello World</b>.</p>
<br>
<li><p>From the <b>Project types</b> list, expand <b>Executable</b> and select <b>Hello World C++ Project</b>. This project type provides a simple Hello World application in C++, and the makefile is automatically created by the CDT.</p>
<br>
@@ -67,63 +67,46 @@ With CDT 4.0, you now select a project type, and that determines what build syst
<br>
<p>A project is created with the default settings and a full set of configurations based on the project type and toolchain you selected.
You should now see the new project in C/C++ Projects view.</p>
+ <p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_basic12.png')">Click here to see an illustration.</a></p>
+ <br>
</ol>
-<h3>Step 2: Creating a new file for the project</h3>
-<p>Now, you will create a new .cpp file (such as main.cpp) that will contain some code that you will copy from another file into an editor. </p>
-
-<ol>
- <li>Right-click on your project in the Navigator.
- <li>Select <b>New &gt; Source File</b>.
- <p>You should now see the new project in the C/C++ Projects view under the project, and the new file opens in the <b>Editor</b> view.</p>
-</ol>
-
-<h3>Step 3: Enter and step through the code</h3>
+<h3>Step 2: Reviewing the code and building the project</h3>
<ol>
- <li>Copy the code from the file <a href="javascript:void(0)"
- onclick="newWin('hw_example.htm')" title="here">main.cpp</a>
-file that was just created.
-<p>
-You can double click the <b>main.cpp</b> tab in the <b>Editor</b>
-view to expand the view. <br>
-<i>Note: Leave a blank line at the end of the code because it is required by some compilers.</i></p>
-<p>On the tab in the <b>Editor</b> view, an asterisk character ("*") prefixes the file name. The asterisk indicates that the file has changed but has not been saved.</p>
- <li>Notice that the <b>Outline</b> view has also been populated
-with objects created from your code. </p>
-<p>If you select an item from the <b>Outline</b> view, the
-corresponding text in the editor is highlighted.
-<li>Save the main.cpp file by clicking <span
- style="font-weight: bold;">File &gt; Save</span> or pressing <b>CTRL+S</b>.
-<li>Build your project by pressing <b>CTRL+B</b>.</p>
-<p>You can read through the build messages in the <b>Console</b> view.
-The project should build successfully, showing the following message:</p>
-<p><tt>Finished building target: HelloWorld.exe</tt></p>
+ <li>From the Project Explorer in the C++ Projects View, double-click the .cpp file that was created for your project, for example, <tt>Hello World.cpp</tt>.
+ <p>This file opens in a default editor. It contains C++ template code for the Hello World example project you selected earlier.</p>
+ <br>
+ <p><b>Note:</b> You can specify a different editor, and add or modify existing code templates in <b>Window &gt; Preferences</b>.</p><p>In addition, the <b>Outline</b> view has also been populated
+with objects created from your code.</p> <p><a href="javascript:void(0)" onClick="newWin('../images/cdt_w_basic13.png')">Click here to see an illustration.</a></p>
+</li>
+<li>Optional: You can type additional code in this file, and then save the changes by clicking <span
+ style="font-weight: bold;">File &gt; Save</span>, or pressing <b>CTRL+S</b>.
+
+ <p><br>Next, you will need to build your project before you can run it.</p><br></li>
+<li>Build your project by pressing <b>CTRL+B</b>, or select the project from the Project Explorer tab in the C++ Projects view and select <b>File &gt; Build Project</b>.</p>
+<p><br><b>Note:</b> If a build generates any errors or warnings, you can see those in the Problems view. If you encounter difficulty, see the topics <a href="../concepts/cdt_c_build_over.htm">Building C/C++ projects</a> and <a href="../concepts/cdt_c_before_you_begin.htm">Before you begin</a><br>.</p></li>
+<li>Read through the build messages in the <b>Console</b> view.
+The project should build successfully.</p>
<br>
<p>You will also see the <b>Outline</b> view has also been populated
-with objects created from your code. </p>
-<p>If you select an item from the <b>Outline</b> view, the
-corresponding text in the editor is highlighted.</p></li>
+with objects created from your code. If you select an item from the <b>Outline</b> view, the
+corresponding text in the editor is highlighted.</p><br>
</ol>
-<h3>Step 4: Running the application</h3>
+<h3>Step 3: Running the application</h3>
+
+<p>To run your application:</p>
<ol>
- <li>To run your application within the C/C++ Perspective, click <b>Run &gt; Run...</b>
- <li>Select <b>C/C++ Local Application</b>.
- <li>Click <b>'New'</b>.
-<li>Click <b>'New'</b>.</p>
+ <li>Within the C/C++ Perspective, click <b>Run &gt; Run</b>.<p><br></p></li>
+ <li>Select <b>C/C++ Local Application</b>.<p><br></p></li>
+ <li>Click <b>New</b>.<p><br></p></li>
-<p>A new Run Configuration is created. Its name and path to executable are provided by the project ('HelloWorld' in our case).
+ <p>A new Run Configuration is created. Its name and path to the executable are provided by the project ('Hello World' in our case).
-<li>Click <b>'Run'</b>.
-</ol>
+ <li>Click <b>Run</b>.<p><br></p>
-<h3>Step 5: Reviewing and interpreting the results in the Console view</h3>
-<p>Now, you should now see the Hello World application running in the <b>Console</b> view.
-The <b>Console</b> also shows which application is running in a title bar.
-You can configure this view to display different elements (such as user input elements) using different colors.</p>
-<ol>
- <li>Type in your name and press Enter.
- <p>The title bar in the <b>Console</b> view shows you when the program has terminated.</p>
+<p>Now, you should see the Hello World application running in the <b>Console</b> view.
+The <b>Console</b> also shows which application is running in a title bar.</p><br></li>
<li>You can click the other views to see the information that they contain.
</ol>

Back to the top