On Windows, Linux/Unix, OS X
Due to mac new security approach a simple download and extract will not work. Follow following steps to install. 1)download with mac browser. If you want to pick a different version of the Eclipse CDT than the one included in the product bundle or you want to add the Arduino Eclipse plugin to an existing installation this is the way to go. NVIDIA® Nsight™ Eclipse Edition is a full-featured IDE powered by the Eclipse platform that provides an all-in-one integrated environment to edit, build, debug and profile CUDA-C applications. Nsight Eclipse Edition supports a rich set of commercial and free plugins. Nsight Eclipse Edition is part of the CUDA Toolkit Installer for Linux and Mac.
Copyright © 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Max Berger
This howto has been avaiable under different versions at different times.
This document is licensed under the Eclipse Public License - v2.0 (EPL v2.0), or any later version. Please see https://www.eclipse.org/legal/epl-2.0/ for details.
Versions between August 2011 and December 2019 where proprietary. They are not be copied, distributed, published, or larger parts being cited without the consent of the author. Small excerpts may be cited if proper attribution including a link to the authors website is given. All rights reserved.
Previous versions of this document (prior to August 2011) where published under the GNU Free Documentation License (GFDL), Version 1.2. Please refer to the appropriate document version should you want to chose that license. Please note that the GFDL does not apply to newer versions, e.g. this version of the document!
- Setting up a compiler
- Setting up Eclipse
- Common Problems
- Older Instructions
There are several freely available C and C++ development environments. Most of them have the disadvantage that they require one particular operating system. The Eclipse IDE was written as a cross-platform development environment. Initially just written for Java, it also has a very good C/C++ development mode.
If you have already tried (and I assume failed, otherwise you wouldn't be reading this document) to install Eclipse CDT, you may want to go directly to the section called “Common Problems”.
This document describes how to install everything necessary to develop with C or C++ using only free tools on the three major operating systems Windows, Linux, and Mac OS X. It uses the Eclipse IDE, which is the same on all operating systems, thus providing a consistent user experience once installed.
There are two versions of this document:
The free version of Setting up Eclipse CDT on Windows, Linux/Unix, Mac OS X can be found on Max Bergers website. It will always be the previous major revision of the document.
The eBook version of Setting up Eclipse CDT on Windows, Linux/Unix, Mac OS X is distributed through Amazon.com, Amazon.co.uk, and Amazon.de. It will always be the current major revision of the document.
At this time, the eBook version contains updates for the following items which are not yet in the free version:
There are no updates in the ebook version at this time.
Screenshots may still reflect older versions of the used software, they are only updated if there is a significant change.
A PDF version of this guide, including Eclipse setup and project debugging is available in the Documentation section.
Following up on the previous guide in the series, this guide will go through the steps of creating a managed build project using Eclipse and the GCC toolchain setup in the previous guide.
There are two main types of CDT projects that can be used in Eclipse. The first one is called a managed build where Eclipse CDT will manage the build. The other option is a Makefile project where a user-supplied Makefile is used with little help from Eclipse. Both methods have their pros and cons and this guide covers both.
This guide will go over the basic steps required to create and set up a managed build project using the toolchain and Eclipse installation done in the first chapter. Note that this guide will not go over the project configuration for specific MCU or SoC as these settings can vary wildly and are beyond the scope of this guide.
Workspace Setup
Not much configuration is required at the workspace level when using a managed build, but it’s a good idea to see if Eclipse has detected the toolchain that was added to the system PATH environment variable earlier in this guide.
First launch Eclipse if it’s not already started. The workspace selection prompt should appear.
If a workspace was created during the Eclipse installation select it, otherwise create it now. It is strongly recommended to create a
unique workspace that will be used exclusively for the projects related to the GCC toolchain that will be installed in this guide. The workspace selected should not have a path name that is excessively long and it is recommended not to use spaces in the path name either. To keep everything well contained and ordered this example will use “C:/eclipse_gcc/eclipse_workspace” as the workspace.
Click Launch.
The Eclipse welcome screen should appear.
The welcome screen can be closed by pressing the X next to the Welcome tab. This reveals the main Eclipse view, which should be empty if this is a new workspace.
Open the workspace preferences by clicking the Window->Preferences menu entry.
Navigate to the “Core Build Toolchains” subsection of the “C/C++” section of the Preferences panel. This should display a list of detected toolchains. If the toolchain was installed correctly and was added to the PATH environment variable, it should appear in the list.
In this example the toolchain for ARM installed earlier was detected with the path to the main GCC executable being C:/eclipse_gcc/gcc/bin/arm-none-eabi-gcc.exe correctly displayed.
That is all the workspace level items of importance for a managed build. The next step is to create the managed build project proper.
Managed Build Project Setup
To create a new managed build project select the File->New->C/C++ Project entry from the File Menu.
In the New C/C++ project dialog select “C Managed Build”.
Click Next. In this next screen, the project name and location should be set as well as the toolchain. Type a name for the project, for example “ex_managed_build” and select a location. If the “Use default location” box is checked the project will be created inside the current workspace, otherwise a directory can be typed or selected using the “Browse” button. As usual it is recommended to keep the project path short without any spaces.
It is also important to select an empty executable project along with the “Cross GCC” toolchain as displayed in the following screenshot.
Click Next. The Select Configurations dialog will display.
There is nothing to change on this screen other than clicking next.
The next “Cross GCC Command” dialog is rather important, this is where we select the toolchain to use for building. To do so it’s necessary to type in the prefix of the GCC toolchain. Most of the time all the executables from a GCC cross compiler will be prefixed with a target triplet. For example, in our ARMv7 toolchain the target triplet is “arm-none-eabi” and the full prefix is “arm-none-eabi-“. The full prefix should be typed in the “Cross Compiler prefix:” box. It is not necessary to enter the path to the toolchain since we already took care of that with the PATH environment variable.
Click Finish. The project should now be created and available in the workspace.
Files can now be added and the build settings set for the particular target for the project. The exact settings are outside the scope of this guide but let’s at least add a simple main file to test the build.
To add a new file right-click on the project, or select the project and click the Project->New->Files menu item.
Type “main.c” in the “Create New File” Dialog and click “Finish”.
Let’s fill the new source file with a minimal C main function.
If you try building the minimal C program, it’s quite likely that an error similar to the following linker error is displayed.
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
Eclipse Cdt For Mac
To fix that common issue --specs=nosys.specs
must be added to the linker command-line options. Note that if the error doesn’t happen it is important not to add the linker option.
To add the option first open the project properties, by right-clicking on the project or by selecting the project and click the Project->Properties menu entry.
Navigate to the “Miscellaneous” category under “Cross GCC Linker” and add the option to the “Linker flags” box.
Cdt For Eclipse Machine
At this point the minimal program should build and everything is set up to start development of an embedded project using the chosen toolchain.
That is it for part 2. Click here for the part 3 looking at creating a Makefile project or check out part 1 for the Eclipse and toolchain configuration guide. Stay tuned for the next articles in this series for setting up a Makefile project. If you can’t wait consult the PDF version of this guide.
Visit the Documentation section for a PDF version of this guide including Eclipse and debugging setup.
Eclipse Cdt For Mac Os X
Questions or comments? Do not hesitate to contact us at blog@jblopen.com. Your questions, comments and, suggestions are appreciated.