|
|
## Getting started
|
|
|
|
|
|
Download from [here](https://www.eclipse.org/downloads/).
|
|
|
These notes are accurate for Eclipse IDE 2020‑12 on my Mac and Ubuntu.
|
|
|
FWIW, I make an annual donation to the Eclipse Foundation.
|
|
|
Download from [here](https://www.eclipse.org/downloads/). These notes are accurate for Eclipse IDE 2020‑12 on my Mac and Ubuntu. FWIW, I make an annual donation to the Eclipse Foundation.
|
|
|
|
|
|
The installer will prompt for what to install. You need the Eclipse IDE for C++ Developers, usually called the `CDT`.
|
|
|
The installer will prompt for what to install. You need the Eclipse IDE for C++ Developers, usually called the `CDT`.
|
|
|
|
|
|
-----
|
|
|
---
|
|
|
|
|
|
### MacOS
|
|
|
|
... | ... | @@ -14,50 +12,33 @@ I accepted the default locations for the Java VM and Eclipse. It worked. |
|
|
|
|
|
### Ubuntu
|
|
|
|
|
|
Installation was not without drama.
|
|
|
**_New 2021!_** The Ubuntu app store offers an older version of Eclipse. I went directly to the [Eclipse site](https://www.eclipse.org/) and downloaded the Debian tarball. After expanding, double click on the installer, the file eclipse-inst within the exploded tarball. Eclipse installed directly into my home directory and worked without drama. I did not need to install a separate JDK.
|
|
|
|
|
|
The recommendation is to `sudo` install.
|
|
|
The app proposes `/root/` which I accepted. That folder is only accessible
|
|
|
if you are actually root. I did so, with `sudo su`, and removed the eclipse installed there.
|
|
|
**both**
|
|
|
|
|
|
I tried again as myself and installed into a folder beneath `~gary`. That seemed
|
|
|
to work but eclipse could not access some of the hidden files and folders beneath
|
|
|
the Cloudy `origin / master`. I did eventually get it all to work by setting
|
|
|
permissions by hand.
|
|
|
|
|
|
*Perhaps* the installation would have been drama-free had I installed as `sudo` but changed
|
|
|
the installation folder to space under `~gary`.
|
|
|
The second install works so I stopped installing.
|
|
|
|
|
|
### both
|
|
|
|
|
|
Launch eclipse when it offers to. I accepted the default workspace location.
|
|
|
Launch eclipse when it offers to. I accepted the default workspace location.
|
|
|
|
|
|
Choose a folder to be your workspace. "eclipe/workspace/" is good.
|
|
|
|
|
|
Choose the workbench circle on the right - This should take you to a standard-looking IDE interface
|
|
|
|
|
|
----------
|
|
|
---
|
|
|
|
|
|
## Adding Cloudy as a Project
|
|
|
|
|
|
Click "File" in the menu bar at top of the screen, "New", and then "Makefile project with existing code"
|
|
|
|
|
|
**Import existing code page** Name the Project whatever you want.
|
|
|
*Existing code location* select the source folder.
|
|
|
Choose C++ as the *language*.
|
|
|
Choose MacOSX GCC (Mac) or Linux GCC (Ubuntu) in the *Toolchain for indexer Settings* list.
|
|
|
**Import existing code page** Name the Project whatever you want. _Existing code location_ select the source folder. Choose C++ as the _language_. Choose MacOSX GCC (Mac) or Linux GCC (Ubuntu) in the _Toolchain for indexer Settings_ list.
|
|
|
|
|
|
Click finish
|
|
|
|
|
|
## Properties for Cloudy project
|
|
|
|
|
|
Right-click on the project name in the project browser tab in the left column and select
|
|
|
*properties* from the menu. It is at the bottom.
|
|
|
Right-click on the project name in the project browser tab in the left column and select _properties_ from the menu. It is at the bottom.
|
|
|
|
|
|
### C/C++ Build section - Builder Settings
|
|
|
|
|
|
Uncheck **Use default build command**
|
|
|
Uncheck **Use default build command**
|
|
|
|
|
|
**Generate Makefiles automatically** Make sure this is unchecked
|
|
|
|
... | ... | @@ -75,8 +56,7 @@ Click **Apply and close** |
|
|
|
|
|
#### Keep windows open
|
|
|
|
|
|
To stop windows from closing automatically search for "reuse" then
|
|
|
deselect "reuse editors" and "close windows automatically"
|
|
|
To stop windows from closing automatically search for "reuse" then deselect "reuse editors" and "close windows automatically"
|
|
|
|
|
|
#### Keyboard Shortcuts
|
|
|
|
... | ... | @@ -94,61 +74,38 @@ In the "Keys" window, there is a textbox below "Scheme" |
|
|
|
|
|
Type keywords into this box to filter the list of keyboard shortcuts. For example, typing "bracket" into the text box shows that the command for "Go to Matching Bracket" is shift+ctrl+P.
|
|
|
|
|
|
|
|
|
#### The local resource is out of sync error
|
|
|
|
|
|
In its default state eclipse cannot deal with files that change outside of its control.
|
|
|
To fix this go to Preferences->general->workspace and enable refresh automatically.
|
|
|
In its default state eclipse cannot deal with files that change outside of its control.\
|
|
|
To fix this go to Preferences->general->workspace and enable refresh automatically.
|
|
|
|
|
|
Also select save automatically before build
|
|
|
|
|
|
|
|
|
### Working with breakpoints
|
|
|
|
|
|
Set a breakpoint by right clicking in the margin to the left of the source.
|
|
|
Start running the code by clicking on bug icon to the right of the hammer build icon.
|
|
|
The code will immediately stop in main and you will be in the debug perspective.
|
|
|
To continue debugging click on the right arrow in the debug window,
|
|
|
to the left of the red square (the stop debugging icon).
|
|
|
|
|
|
Set a breakpoint by right clicking in the margin to the left of the source.\
|
|
|
Start running the code by clicking on bug icon to the right of the hammer build icon. The code will immediately stop in main and you will be in the debug perspective. To continue debugging click on the right arrow in the debug window, to the left of the red square (the stop debugging icon).
|
|
|
|
|
|
### Creating a debug configuration
|
|
|
|
|
|
The default configuration will create an optimized build, which may not be useful for debugging.
|
|
|
To create a debug build, with no optimization, we need to create a debug configuration and
|
|
|
add the *debug* option to the makefile.
|
|
|
The default configuration will create an optimized build, which may not be useful for debugging. To create a debug build, with no optimization, we need to create a debug configuration and add the _debug_ option to the makefile.
|
|
|
|
|
|
*To create a debug configuration* right click on the project name in the project explorer,
|
|
|
the window on the left side of the IDE.
|
|
|
Select properties / C/C++ build.
|
|
|
_To create a debug configuration_ right click on the project name in the project explorer, the window on the left side of the IDE. Select properties / C/C++ build.\
|
|
|
You add a debug configuration with the "manage configurations" button.
|
|
|
|
|
|
Select the debug configuration then the behavior option.
|
|
|
Here I add "use parallel build" and set the number of threads,
|
|
|
add "debug" to the "Build (incremental build) option,
|
|
|
and "distclean" to the "clean" option.
|
|
|
|
|
|
The "builder settings" should show a build command something like "make debug -j4".
|
|
|
Select apply / ok and the project will build.
|
|
|
Select the debug configuration then the behavior option. Here I add "use parallel build" and set the number of threads, add "debug" to the "Build (incremental build) option, and "distclean" to the "clean" option.
|
|
|
|
|
|
The "builder settings" should show a build command something like "make debug -j4". Select apply / ok and the project will build.
|
|
|
|
|
|
### Changing configurations
|
|
|
|
|
|
Right click on the project name in the project explorer window.
|
|
|
Right click on the project name in the project explorer window.\
|
|
|
The "build configuration" allows the configuration to be changed.
|
|
|
|
|
|
|
|
|
#### Eclipse indexer confusion when building in one of the sys_??? directories
|
|
|
|
|
|
The Eclipse indexer, which derives information about variables and routines from header file information,
|
|
|
may become confused.
|
|
|
The symptom is that the source editor will claim that a larger number of syntax errors are present,
|
|
|
but the code will build properly.
|
|
|
This is caused by Eclipse looking for the header files in the sys_??? directory rather than the source directory.
|
|
|
To fix, go to Properties -> C/C++ General -> Paths and Symbols -> Includes -> Library Paths and "Libraries.
|
|
|
Add the source directory.
|
|
|
The settings are applicable to the selected project only.
|
|
|
The Eclipse indexer, which derives information about variables and routines from header file information, may become confused. The symptom is that the source editor will claim that a larger number of syntax errors are present, but the code will build properly. This is caused by Eclipse looking for the header files in the sys_??? directory rather than the source directory. To fix, go to Properties -> C/C++ General -> Paths and Symbols -> Includes -> Library Paths and "Libraries. Add the source directory. The settings are applicable to the selected project only.
|
|
|
|
|
|
-------
|
|
|
---
|
|
|
|
|
|
Return to [DeveloperPages](DeveloperPages) or go [home](home) |
|
|
\ No newline at end of file |