Getting Started documentation update. (#1056)
* Put Core Build and Managed Build items in separate topics. * Added two images to Creating a CMake project. * Added new pages about creating a CBS Makefile project, using existing code, launch bar, building, running, and debbuggin a project. * Renamed "Creating a simple application" to "Creating a Managed Build System Makefile project" and replaced two images. * Removed "Creating a Makefile project", because it was duplicate information. Fixes #992
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 33 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cbs_build.png
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cbs_build_debug.png
Normal file
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 34 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cbs_debug_cmake.png
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cbs_debugging.png
Normal file
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 38 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cbs_empty_cmake_project.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cbs_existing_code_cmake.png
Normal file
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 32 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cbs_run_cmake.png
Normal file
After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 24 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/cdt_w_basic03b.png
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/launchbar.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
doc/org.eclipse.cdt.doc.user/images/launchbar_preferences.png
Normal file
After Width: | Height: | Size: 22 KiB |
|
@ -0,0 +1,116 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Building a project
|
||||
|
||||
During Core Build System (CBS) project creation a launch configuration
|
||||
with the same name is created along with it. The Build settings are
|
||||
managed in the *Build Settings* tab of the launch configuration.
|
||||
|
||||
CBS projects rely on the xref:cbs_launchbar.adoc[Launch Bar]. Make
|
||||
sure the launch bar is installed and enabled.
|
||||
|
||||
=== Building for Run
|
||||
|
||||
. Select the launch configurion of the project you want to build.
|
||||
. Select launch mode *Run*.
|
||||
. Press the *Build* button in the launch bar.
|
||||
. Inspect the build output in the Console window.
|
||||
. Find the build results in the Project Explorer.
|
||||
|
||||
image:cbs_build.png[Build a project for Run]
|
||||
|
||||
=== Building for Debug
|
||||
|
||||
To build for Debug:
|
||||
|
||||
. Select the launch configurion of the project you want to build.
|
||||
. Select launch mode *Debug*.
|
||||
. Press the *Build* button.
|
||||
. Inspect the build output in the Console window.
|
||||
. Find the build results in the Project Explorer.
|
||||
|
||||
image:cbs_build_debug.png[Build a project for Debug]
|
||||
|
||||
=== Changing build settings
|
||||
|
||||
The launch configuration presents separate build settings for launch mode
|
||||
Run and Debug. You will see the build settings depending on the selected
|
||||
launch mode.
|
||||
|
||||
To change Run build settings:
|
||||
|
||||
. Set the launch mode to *Run*
|
||||
. Edit the project's launch configuration. Click on the gear icon.
|
||||
|
||||
image:cbs_edit_launch_config_run.png[Edit launch configuration]
|
||||
|
||||
The edit launch configuration wizard will open. Select the *Build
|
||||
Settings* tab.
|
||||
|
||||
The only settings that can be changed are the build chain, and how
|
||||
CMake or Make is called. There are no options to set pre-processor
|
||||
symbols or include paths. This makes that the project can easily be
|
||||
shared with other IDEs, command line, or continuous integration flows.
|
||||
|
||||
The following picture shows the build settings of a CMake project.
|
||||
|
||||
image:cbs_build_settings_tab_cmake.png[CMake build settings tab]
|
||||
|
||||
=== Makefile projects BUILD_MODE
|
||||
|
||||
For CBS Makefile projects the launch mode is passed to `make` via
|
||||
environment variable `BUILD_MODE`. In the Makefile you can make use of
|
||||
this variable to set the wanted `CFLAGS` per launch mode.
|
||||
|
||||
[cols="1,1"]
|
||||
|===
|
||||
|Launch mode | BUILD_MODE
|
||||
|
||||
|Run
|
||||
|run
|
||||
|
||||
|Debug
|
||||
|debug
|
||||
|===
|
||||
|
||||
Here is some example code that makes use of `BUILD_MODE` to set the
|
||||
wanted `CFLAGS`:
|
||||
|
||||
[source,makefile]
|
||||
----
|
||||
ifeq ($(BUILD_MODE),debug)
|
||||
CFLAGS += -g -O0
|
||||
else ifeq ($(BUILD_MODE),run)
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
----
|
||||
|
||||
icon:arrow-circle-right[] xref:cbs_run_project.adoc[Next: Running a project]
|
|
@ -0,0 +1,81 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Debugging a project
|
||||
|
||||
Debugging a CBS project is done via the xref:cbs_launchbar.adoc[Launch Bar]. Make
|
||||
sure the launch bar is installed and enabled.
|
||||
|
||||
First build the project for Debug.
|
||||
See xref:cbs_build_project.adoc[Building a project].
|
||||
|
||||
. Select the launch configuration of the project you want to run.
|
||||
. Select launch mode *Debug*.
|
||||
. Press the *Debug* button in the launch bar.
|
||||
. Confirm the switch to the Debug Perspective.
|
||||
|
||||
image:cbs_debug_cmake.png[Launch a CMake project for Debug]
|
||||
|
||||
The Perspective will change to *Debug*, and you can start debugging.
|
||||
|
||||
image:cbs_debugging.png[Debugging a CMake project]
|
||||
|
||||
|
||||
=== Changing debug settings
|
||||
|
||||
To change debug settings:
|
||||
|
||||
. Set the launch mode to *Debug*
|
||||
. Edit the project's launch configuration. Click on the gear icon.
|
||||
|
||||
image:cbs_edit_launch_config_debug.png[Edit launch configuration]
|
||||
|
||||
The edit launch configuration wizard will open. Notice that there are
|
||||
now two extra tabs *Debugger* and *Source*, because the launch mode is
|
||||
*Debug*. These are not present in launch mode *Run*.
|
||||
|
||||
On the *Main* tab you can set an alternative C/C++ application, and
|
||||
you can enable or disable build before launch.
|
||||
|
||||
On the *Arguments* tab you specify optional arguments, and you can
|
||||
change the working directory.
|
||||
|
||||
On the *Environment* tab you define optional environment variables.
|
||||
|
||||
On the *Debugger* tab you can set an alternative debugger. If the
|
||||
debugger name is not an absolute path, CDT will look first for the
|
||||
debugger in the selected toolchain in the *Build Settings* tab. When
|
||||
it is not found in the toolchain the debugger is searched in the
|
||||
*PATH* environment variable defined locations.
|
||||
|
||||
On the *Source* tab extra paths outside the project folder can be
|
||||
defined to look for source code.
|
||||
|
||||
image:cbs_launch_config_tab_debug.png[Launch configuration debug tab]
|
|
@ -0,0 +1,55 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Launch Bar
|
||||
|
||||
Core Build System (CBS) projects rely on the *Launch Bar*. Make sure
|
||||
the _LaunchBar UI_ feature is installed and enabled. In the global
|
||||
preferences the launch bar can be enabled or disabled.
|
||||
|
||||
image:launchbar_preferences.png[Launch Bar preferences]
|
||||
|
||||
The launch bar exists out of several components:
|
||||
|
||||
image:launchbar.png[Launch Bar]
|
||||
|
||||
. Build button, to launch a build.
|
||||
. Run button, to launch a run. This button will change to a Debug
|
||||
button in Debug mode.
|
||||
. Stop button, to stop a Run or Debug session.
|
||||
. Launch mode selector. To change between Run and Debug mode.
|
||||
. Launch configuration selector.
|
||||
. Edit launch configuration. To change the launch configuration
|
||||
properties.
|
||||
. Target selector. Not always visible.
|
||||
. Edit target.
|
||||
|
||||
icon:arrow-circle-right[] xref:cbs_build_project.adoc[Next: Building a
|
||||
project]
|
|
@ -0,0 +1,67 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Running a project
|
||||
|
||||
Running a CBS project is done via the xref:cbs_launchbar.adoc[Launch Bar]. Make
|
||||
sure the launch bar is installed and enabled.
|
||||
|
||||
First build the project for Run.
|
||||
See xref:cbs_build_project.adoc[Building a project].
|
||||
|
||||
. Select the launch configuration of the project you want to run.
|
||||
. Select launch mode *Run*.
|
||||
. Press the *Run* button in the launch bar.
|
||||
. Inspect the program output in the Console window.
|
||||
|
||||
image:cbs_run_cmake.png[Launch a CMake project for Run]
|
||||
|
||||
=== Changing run settings
|
||||
|
||||
To change run settings:
|
||||
|
||||
. Set the launch mode to *Run*
|
||||
. Edit the project's launch configuration. Click on the gear icon.
|
||||
|
||||
image:cbs_edit_launch_config_run.png[Edit launch configuration]
|
||||
|
||||
The edit launch configuration wizard will open.
|
||||
|
||||
On the *Main* tab you can set an alternative C/C++ application, and
|
||||
you can enable or disable build before launch.
|
||||
|
||||
On the *Arguments* tab you specify optional arguments, and you can
|
||||
change the working directory.
|
||||
|
||||
On the *Environment* tab you define optional environment variables.
|
||||
|
||||
image:cbs_launch_config_tab_main.png[Launch configuration main tab]
|
||||
|
||||
icon:arrow-circle-right[] xref:cbs_debug_project.adoc[Next: Debugging a project]
|
|
@ -0,0 +1,67 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Using existing code
|
||||
|
||||
This tutorial describes how to create a new Core Build System
|
||||
(CBS) project for use with existing code.
|
||||
|
||||
Using existing code is done by creating a new **empty** CDT project in
|
||||
the top directory containing the existing source files. CDT project
|
||||
files will be created in the existing source directory.
|
||||
|
||||
=== Using an existing CMake project
|
||||
|
||||
To create an empty CMake project in CDT select the template *Empty or Existing CMake
|
||||
Project* in the *New C/{cpp} Project* wizard.
|
||||
|
||||
image:cbs_empty_cmake_project.png[Empty or Existing CMake Project]
|
||||
|
||||
In the *New CMake Project* wizard uncheck *Use default location*
|
||||
and set the location of the existing code.
|
||||
|
||||
image:cbs_existing_code_cmake.png[Existing code CMake]
|
||||
|
||||
More information about creating a CMake project is described in
|
||||
xref:new_cmake_proj.adoc[Creating a CMake project]
|
||||
|
||||
=== Using an existing Makefile project
|
||||
|
||||
Create a CBS Makefile project in CDT as described in
|
||||
xref:new_cbs_makefile_proj.adoc[Creating a Core Build System Makefile project]
|
||||
with the following changes:
|
||||
|
||||
In the *New Makefile Project* wizard uncheck *Use default location*,
|
||||
set the location of the existing code, and uncheck *Create Hello
|
||||
World Source and Makefile example*.
|
||||
|
||||
image:cbs_existing_code_makefile.png[Existing code Makefile]
|
||||
|
||||
icon:arrow-circle-right[] xref:cbs_launchbar.adoc[Next: Launch Bar]
|
|
@ -36,7 +36,7 @@ Development Toolkit (CDT) to:
|
|||
* xref:cdt_w_prepare_workbench.adoc[Prepare the Workbench]
|
||||
* xref:cdt_w_basic.adoc[Create a simple application]
|
||||
* xref:new_cmake_proj.adoc[Creating a CMake project]
|
||||
* xref:cdt_w_newproj.adoc[Create a Makefile project]
|
||||
* xref:cdt_w_basic.adoc[Create a Managed Build System Makefile project]
|
||||
* xref:cdt_w_import.adoc[Import an existing project]
|
||||
* xref:cdt_w_newcpp.adoc[Create a {cpp} file]
|
||||
* xref:cdt_w_newmake.adoc[Create a makefile]
|
||||
|
|
|
@ -28,18 +28,13 @@ endif::[]
|
|||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Tutorial: Creating a simple application
|
||||
== Tutorial: Creating a Managed Build System Makefile project
|
||||
|
||||
In this tutorial, you will use the CDT to create a simple 'Hello World'
|
||||
application. This tutorial describes the process of creating a new {cpp}
|
||||
project where the build is automatically managed by the CDT, and running
|
||||
the program.
|
||||
|
||||
*NOTE*: In earlier versions of the CDT, there were two separate project
|
||||
types: Managed make (automatically generated a makefile) and Standard
|
||||
make (required the user's makefile to build). Now with CDT, you just
|
||||
select a project type, and that determines what build system to use.
|
||||
|
||||
To create a simple "Hello World" application using CDT, perform the
|
||||
following general steps:
|
||||
|
||||
|
@ -57,10 +52,13 @@ image:cdt_w_basic02.png[Select File > New > Project menu
|
|||
option,width=591,height=183]
|
||||
+
|
||||
. Select the type of project to create. For this tutorial, expand the
|
||||
*{cpp}* folder and select *{cpp} Project* and click *Next*.
|
||||
*C/{cpp}* folder and select *C/{cpp} Project* and click *Next*.
|
||||
+
|
||||
image:cdt_w_basic03a.png[Select project
|
||||
type,width=525,height=500]
|
||||
image:cdt_w_basic03a.png[Select project type]
|
||||
+
|
||||
. Select *{cpp} Managed Build* and click *Next*.
|
||||
+
|
||||
image:cdt_w_basic03b.png[Select {cpp} Managed Build]
|
||||
+
|
||||
. The *{cpp} Project* wizard opens.
|
||||
+
|
||||
|
@ -139,12 +137,6 @@ populated with objects created from your code.
|
|||
image:cdt_w_basic13.png[C Editor with Outline
|
||||
view,width=731,height=333]
|
||||
+
|
||||
*NOTE:* You can specify a different editor, and add or modify existing
|
||||
code templates in *Window > Preferences*.
|
||||
+
|
||||
*OPTIONAL*: You can type additional code in this file, and then save the
|
||||
changes by clicking File > Save, or pressing *CTRL+S*.
|
||||
+
|
||||
Next, you will need to build your project before you can run it.
|
||||
+
|
||||
. Build your project by pressing *CTRL+B*, or select the project in the
|
||||
|
|
|
@ -32,7 +32,7 @@ endif::[]
|
|||
|
||||
You can begin coding your HelloWorld program. The .cpp file that you
|
||||
create will be saved in the project folder you just created
|
||||
xref:cdt_w_newproj.adoc[Creating a Makefile project].
|
||||
xref:cdt_w_basic.adoc[Creating a Managed Build System Makefile project].
|
||||
|
||||
Files are edited in the C/{cpp} editor located to the right of the C/{cpp}
|
||||
Projects view. The left margin of the C/{cpp} editor, called the marker
|
||||
|
@ -88,9 +88,9 @@ xref:cdt_w_newmake.adoc[image:ngnext.gif[Next
|
|||
icon,width=16,height=16]] *xref:cdt_w_newmake.adoc[Next: Creating your
|
||||
makefile]*
|
||||
|
||||
xref:cdt_w_newproj.adoc[image:ngback.gif[Back
|
||||
icon,width=16,height=16]] *xref:cdt_w_newproj.adoc[Back: Creating your
|
||||
project]*
|
||||
xref:cdt_w_import.adoc[image:ngback.gif[Back
|
||||
icon,width=16,height=16]] *xref:cdt_w_import.adoc[Back: Importing an
|
||||
existing project]*
|
||||
|
||||
image:ngconcepts.gif[Related concepts,width=143,height=21]
|
||||
|
||||
|
|
|
@ -1,165 +0,0 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Creating a Makefile project
|
||||
|
||||
This tutorial describes the process of creating a new {cpp} project that
|
||||
includes a makefile, and debugging the program.
|
||||
|
||||
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.
|
||||
|
||||
To create a project:
|
||||
|
||||
. Select *File > New > Project*.
|
||||
+
|
||||
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.
|
||||
+
|
||||
. Select the type of project to create. For this tutorial, expand the
|
||||
*C/{cpp}* folder and select *{cpp} Project*.
|
||||
+
|
||||
The *{cpp} Project* wizard opens. javascript:void(0)[Click here to see an
|
||||
illustration.]
|
||||
+
|
||||
By default, the CDT filters the *Toolchain* and *Project types* that
|
||||
currently display in those lists are based on the language support for
|
||||
the {cpp} Project wizard you selected for this tutorial.
|
||||
+
|
||||
. In the *Project name* field, type HelloWorld.
|
||||
. Leave the *Use Default Location* option selected.
|
||||
+
|
||||
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:
|
||||
* *Executable* - Provides an executable application. This project type
|
||||
folder contains three templates.
|
||||
** *Hello World {cpp} Example* provides a simple {cpp} Hello World
|
||||
application with main().
|
||||
** *Hello World ANSI C Example* provides a simple C Hello World
|
||||
application with main().
|
||||
** *Empty Project* provides a single source project folder that contains
|
||||
no files.
|
||||
+
|
||||
After you select this template, the result is a project with only the
|
||||
meta-data files required for the project type. You are expected to
|
||||
provide source files for the project's target.
|
||||
+
|
||||
The makefile for the *Executable* project type is automatically created
|
||||
by the CDT.
|
||||
+
|
||||
|
||||
* *Shared Library* - 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.`version`, where `version` 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.
|
||||
* *Static Library* - 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.
|
||||
* *Makefile Project* - 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.
|
||||
+
|
||||
By default, the CDT filters the *Toolchain* and *Project types* that
|
||||
currently display in those lists based on the language support for the
|
||||
{cpp} Project wizard you selected for this tutorial.
|
||||
+
|
||||
|
||||
. From the *Project types* list, expand *Makefile project* and select
|
||||
*Empty Project*. This project lets you enter the source file and the
|
||||
makefile yourself.
|
||||
. Select a required toolchain from the *Toolchain* list.
|
||||
+
|
||||
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.
|
||||
There can be several toolchains available, depending on the compilers
|
||||
installed on your system.
|
||||
. Click *Next*.
|
||||
. (Optional) On the *Select Configurations* page, Click *Advanced
|
||||
Settings*.
|
||||
* Expand *C/{cpp}Build > Settings*. Click the *Binary Parsers* tab.
|
||||
+
|
||||
javascript:void(0)[Click here to see an illustration.]
|
||||
+
|
||||
* In the *Binary Parser* list, select the error parser that is
|
||||
appropriate for your platform. Other project settings can be modified
|
||||
here as well. The default selection is probably OK.
|
||||
+
|
||||
To ensure the accuracy of the C/{cpp} 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/{cpp} Projects view. You can also view the contents of
|
||||
the .o file in the C/{cpp} editor.
|
||||
+
|
||||
Click *OK* to close the Project Properties window.
|
||||
. Click *Finish*.
|
||||
. If a message box prompts you to change perspectives, click *Yes*.
|
||||
|
||||
Your new project displays in the Project Explorer view. Your project is
|
||||
empty because you have not yet created files for your project. You may
|
||||
see an error since there is nothing to build yet for your project. You
|
||||
can now start writing the code for your HelloWorld program.
|
||||
|
||||
*Tip:* You can view and modify the properties of your HelloWorld project
|
||||
at any time by right-clicking on the project in the *Project Explorer*
|
||||
view and clicking Properties.
|
||||
|
||||
xref:cdt_w_newcpp.adoc[image:ngnext.gif[Next
|
||||
Icon,width=16,height=16]] xref:core_build_system.adoc[*Next: Core Build System*]
|
||||
|
||||
For more information about:
|
||||
|
||||
* Projects, see *Workbench User Guide > Concepts > Workbench >
|
||||
Resources*
|
||||
* The workspace, see *Workbench User Guide > Tasks > Upgrading Eclipse*
|
||||
|
||||
image:ngconcepts.gif[Related concepts,width=143,height=21]
|
||||
|
||||
* xref:../concepts/cdt_c_over_cdt.adoc[CDT overview]
|
||||
* xref:../concepts/cdt_c_projects.adoc[CDT projects]
|
||||
* xref:../concepts/cdt_c_proj_file_views.adoc[Project file views]
|
||||
|
||||
image:ngtasks.gif[Related tasks,width=143,height=21]
|
||||
|
||||
* xref:../tasks/cdt_o_proj_files.adoc[Working with C/{cpp} project files]
|
||||
|
||||
image:ngref.gif[Related reference,width=143,height=21]
|
||||
|
||||
* xref:../reference/cdt_o_proj_prop_pages.adoc[C/{cpp} Projects view]
|
|
@ -0,0 +1,47 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
= Core Build System contents
|
||||
|
||||
xref:core_build_system.adoc[Core Build System]
|
||||
|
||||
xref:new_cmake_proj.adoc[Creating a CMake project]
|
||||
|
||||
xref:new_cbs_makefile_proj.adoc[Creating a Core Build System Makefile project]
|
||||
|
||||
xref:cbs_using_existing_code.adoc[Using existing code]
|
||||
|
||||
xref:cbs_launchbar.adoc[Launch Bar]
|
||||
|
||||
xref:cbs_build_project.adoc[Building a project]
|
||||
|
||||
xref:cbs_run_project.adoc[Running a project]
|
||||
|
||||
xref:cbs_debug_project.adoc[Debugging a project]
|
|
@ -0,0 +1,45 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
= Legacy Managed Build System contents
|
||||
|
||||
xref:cdt_w_basic.adoc[Tutorial: Creating a Managed Build System Makefile project]
|
||||
|
||||
xref:cdt_w_import.adoc[Tutorial: Importing an existing project]
|
||||
|
||||
xref:cdt_w_newcpp.adoc[Creating your {cpp} file]
|
||||
|
||||
xref:cdt_w_newmake.adoc[Creating a makefile]
|
||||
|
||||
xref:cdt_w_build.adoc[Building a project]
|
||||
|
||||
xref:cdt_w_debug.adoc[Debugging a project]
|
||||
|
||||
xref:cdt_w_existing_code.adoc[Importing your C/{cpp} source files into Eclipse]
|
|
@ -0,0 +1,73 @@
|
|||
////
|
||||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
|
||||
This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
which accompanies this distribution, and is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
////
|
||||
|
||||
// pull in shared headers, footers, etc
|
||||
:docinfo: shared
|
||||
|
||||
// support image rendering and table of contents within GitHub
|
||||
ifdef::env-github[]
|
||||
:imagesdir: ../../images
|
||||
:toc:
|
||||
:toc-placement!:
|
||||
endif::[]
|
||||
|
||||
// enable support for button, menu and keyboard macros
|
||||
:experimental:
|
||||
|
||||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
|
||||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
|
||||
// that the checked in html is up to date.
|
||||
// do_generate_asciidoc.sh can also be used to apply this header to all the
|
||||
// adoc files.
|
||||
// ENDOFHEADER
|
||||
|
||||
== Creating a Core Build System Makefile project
|
||||
|
||||
This tutorial describes the process of creating a new C/{cpp} project that includes a Makefile file.
|
||||
|
||||
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.
|
||||
|
||||
To create a project:
|
||||
|
||||
. Select menu:File[New > Project].
|
||||
+
|
||||
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.
|
||||
. Select the type of project to create. For this tutorial, expand the *C/{cpp}* folder and select *C/{cpp} Project*.
|
||||
. Click btn:[Next].
|
||||
|
||||
image:cdt_w_basic03a.png[Select project type]
|
||||
|
||||
The *C/{cpp} Project* wizard opens:
|
||||
|
||||
image:c_cpp_project_wizard.png[width=515]
|
||||
|
||||
By default, the CDT presents all *C/{cpp} Project* templates.
|
||||
|
||||
. Select the *Make* template filter and choose from the *Makefile project* project template.
|
||||
+
|
||||
image:c_cpp_project_wizard_makefile.png[]
|
||||
+
|
||||
. Click btn:[Next].
|
||||
. In the *Project name* field, provide a name for the new project.
|
||||
. Leave the *Use Default Location* option selected.
|
||||
. Select *Create Hello World Source and Makefile example* to
|
||||
get a Hello World example application.
|
||||
. Click btn:[Finish].
|
||||
. If a message box prompts you to change perspectives, click btn:[Yes].
|
||||
|
||||
image:c_cpp_project_wizard_makefile_properties.png[]
|
||||
|
||||
Your new project displays in the Project Explorer view.
|
||||
Your project may be empty if you did not select the Hello World example creation.
|
||||
You can now start writing the code for your application or importing code from elsewhere.
|
||||
|
||||
icon:arrow-circle-right[] xref:cbs_using_existing_code.adoc[Next: Using existing code]
|
|
@ -38,14 +38,13 @@ A project has an associated builder that can incrementally compile source files
|
|||
To create a project:
|
||||
|
||||
. Select menu:File[New > Project].
|
||||
|
||||
|
||||
+
|
||||
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.
|
||||
|
||||
. Select the type of project to create. For this tutorial, expand the *C/{cpp}* folder and select *C/{cpp} Project*.
|
||||
. Click btn:[Next].
|
||||
|
||||
image:cdt_w_basic03a.png[Select project type]
|
||||
|
||||
The *C/{cpp} Project* wizard opens:
|
||||
|
||||
|
@ -67,8 +66,10 @@ By default, the CDT presents all *C/{cpp} Project* templates.
|
|||
. Click btn:[Finish].
|
||||
. If a message box prompts you to change perspectives, click btn:[Yes].
|
||||
|
||||
image:c_cpp_project_wizard_cmake_properties.png[]
|
||||
|
||||
Your new project displays in the Project Explorer view.
|
||||
Your project may be empty because you have not yet created files for your project.
|
||||
You can now start writing the code for your application or importing code from elsewhere.
|
||||
|
||||
icon:arrow-circle-right[] xref:cdt_w_newcpp.adoc[Next: Creating your {cpp} file]
|
||||
icon:arrow-circle-right[] xref:new_cbs_makefile_proj.adoc[Next: Creating a Makefile project]
|
||||
|
|
|
@ -2,15 +2,24 @@
|
|||
<?NLS TYPE="org.eclipse.help.toc"?>
|
||||
<toc label="Getting Started">
|
||||
<topic label="Preparing the Workbench" href="getting_started/cdt_w_prepare_workbench.htm"/>
|
||||
<topic label="Creating a simple application" href="getting_started/cdt_w_basic.htm"/>
|
||||
<topic label="Creating a Makefile project" href="getting_started/cdt_w_newproj.htm"/>
|
||||
<topic label="Core Build System" href="getting_started/index_cbs.htm">
|
||||
<topic label="Core Build System" href="getting_started/core_build_system.htm"/>
|
||||
<topic label="Creating a CMake project" href="getting_started/new_cmake_proj.htm"/>
|
||||
<topic label="Creating a Core Build System Makefile project" href="getting_started/new_cbs_makefile_proj.htm"/>
|
||||
<topic label="Using existing code" href="getting_started/cbs_using_existing_code.htm"/>
|
||||
<topic label="Launch Bar" href="getting_started/cbs_launchbar.htm"/>
|
||||
<topic label="Building a project" href="getting_started/cbs_build_project.htm"/>
|
||||
<topic label="Running a project" href="getting_started/cbs_run_project.htm"/>
|
||||
<topic label="Debugging a project" href="getting_started/cbs_debug_project.htm"/>
|
||||
</topic>
|
||||
<topic label="Legacy Managed Build System" href="getting_started/index_mbs.htm">
|
||||
<topic label="Creating a Managed Build System Makefile project" href="getting_started/cdt_w_basic.htm"/>
|
||||
<topic label="Importing an existing project" href="getting_started/cdt_w_import.htm"/>
|
||||
<topic href="getting_started/cdt_w_newcpp.htm" label="Creating a C++ file"/>
|
||||
<topic href="getting_started/cdt_w_newmake.htm" label="Creating a makefile"/>
|
||||
<topic label="Building a project" href="getting_started/cdt_w_build.htm"/>
|
||||
<topic label="Debugging projects" href="getting_started/cdt_w_debug.htm"/>
|
||||
<topic label="Importing C/C++ source files into Eclipse" href="getting_started/cdt_w_existing_code.htm"/>
|
||||
</topic>
|
||||
<!--topic label="Updating the CDT" href="getting_started/cdt_w_install_cdt.htm"/-->
|
||||
</toc>
|
||||
|
|