Apple’s Xcode development system is superb for developing applications, but sometimes you just want to write C or C++ code for research or school. Composing a serious chunk of code with
- Manual Eclipse CDT Mac OS Snow Leopard Installation & Demonstration Guide Przemek Lach 9/3/2013 This guide shows how to use install Eclipse and C-‐Compiler and how to test the setup by creating a simple ‘hello world’ program.
- The Eclipse C++ IDE for Arduino (formally Arduino C++ IDE) is a set of plug-ins that provide a professional, yet easy to use development environment for Arduino programming that leverages the power of the industry leading Eclipse CDT.
After you download and install the latest version of Java from Oracle, you then need to adjust the path that is used for Eclipse. Given that you installed the 1.8 Java in some known location, edit the eclipse.ini file and add a pointer to the VM for the new Java.
vi is no longer acceptable,* so users in this frame of mind are now using Eclipse, a modern IDE, that’s also free. Here’s how to get gcc without installing Apple’s Xcode and then install Eclipse for C/C++ programming.What’s the Motivation?
At work recently, my wife was chatting with a colleague who was taking his first C++ class. She taught him how to use Eclipse on a Mac, even though he resisted at first. However, later, he came back and commented that the other students were trying to manage ever increasingly complex projects with the vi editor. It was taking them four, six, or even 20 hours in some cases to complete their homework each week. He finished his, typically, in 30 minutes. That’s the power of an IDE with a modern debugger. That last item, the debugger, can’t be emphasized enough. Print statements in your code are oh, so yesteryear with a tool like this. Time is money, and efficiency reflects on you as a programmer.So if you’re a scientist, researcher or engineer who wants to write some research code, not intended as a GUI app, in Java, C, C++ or Fortran, you need to dump vi as an editor* (or Emacs or Nedit or whatever) immediately and get with this kind of IDE. Things are moving far too fast nowadays not to make this important move. (Clearly, I’m speaking to an older crowd here.**)
To be perfectly clear, Apple’s Xcode is a fabulous development system for C, C++, Objective-C and even Fortran 77***. You can build native OS X and iOS apps. But many researchers and scientists aren’t interested in Xcode. They’ve come from a Linux or other UNIX platform, like IBM’s AIX, and they just want to carry on their research in Eclipse on a Mac. This how-to is primarily for them. But, as I mentioned above, students who are taking their first programming class and own a Mac will also find this discussion useful — indeed mandatory. Remember, this is an introduction to whet your appetite and get you launched, not a complete Eclipse tutorial.
Also, this how-to for the sake of simplicity focuses on C/C++, but Eclipse can handle a myriad of languages, including, but not limited to, Java and Fortran. Let’s start with C/C++.
Getting the gcc Compiler
As an aside, when you install Apple’s Xcode (free from the Mac App Store only in Lion), gcc is automatically installed in /usr/bin. But if you have a mind to work with just Eclipse and gcc, you’ll need a way to install gcc without, if it pleases you, installing Apple’s Xcode first. (For reference, here’s a how-to on installing Xcode and gcc.)
There are at least two places I know of where you can get a gcc installer package for OS X:
- Developer Tools 4.0 Source
- The OS X High Performance Computing page at Sourceforge managed by Dr. Gaurav Khanna at the University of Mass.
If you find other sources, let us know.
Installing Eclipse
Here’s a handy reference on where to get Eclipse for the Mac. Version 3.7 (“Indigo”) installs nicely in Lion and seems to work okay, but our household hasn’t put it to a grueling acid test with OS X 10.7.1.Eclipse Download for CC++, 64-bitThe download is a …tar.gz file, so move it where you want the Eclipse directory to be because when you double click it, the package will be unzipped and untared right there. After Eclipse is installed, you’ll see it as an app, just like any other, with this icon.
It’s easy to create an alias to eclipse.app, if you wish, and place it in your /Application directory. Because the Eclipse IDE itself is written in Java, if you’re running a clean copy of Lion, you’ll need to download the Java runtime before the Eclipse app will launch. Just double-click on Eclipse, and it’ll trigger the required Java runtime download. Nothing else to do. If you’re in Snow Leopard, the Java runtime is already there.
Java runtime downloadThis first thing you’ll see when you run Eclipse is that it asks for the location of your workspace. I typically create a directory in /Users/john called Programming where I do any code development. (Which is not much these days.)
Workspace SelectionAfter you select your workspace, you’ll be confronted with an Eclipse peculiarity. A welcome page will be launched that brings a real feeling of WTF to many users. Here it is.
Welcome screenThe trick is to realize that the icon on the far right, circled in red above, takes you into the workbench. For that named workspace, this one time is the only time you’ll see that screen.
Once the IDE is launched, there are just a few details before you can build a project. Again, for simplicity, lets stay with C/C++. From the Eclipse File menu, select “New” and then C++ Project.
Eclipse - New ProjectInstall Cdt In Eclipse
Experienced Eclipse users know the drill. Name the project, make sure you’ve identified the location of your compiler in the Toolchain, and so on. (It may be different than the default install by Apple’s Xcode. The screen shot below shows Apple’s install of gcc, marked as MacOSX GCC, because I’d previously installed Xcode on that Mac.)
ConfigurationNewbies may want to select the Hello World project just to see how things get set up. Make sure you work your way through the setup with Next > at the bottom and don’t click the Finish button too soon. A more detailed examination of this set up and the ins-and-outs of Eclipse are beyond the scope of this getting started article. The goal here is simply an introduction for Mac users. And you’re not alone. There’s a huge body of knowledge on the Internet about Eclipse. Here’s a start.
If all went well, you’ll be in the Eclipse IDE with the Hello World program in the editor and a Make file already created. This environment is called the Eclipse workbench.
Eclipse Workbench w/ default “Hello World” codeIt may take you some start-up time to learn Eclipse, but trust me, coding the old way will soon bog you down. The Xcode and Eclipse developers learn from each other, so if you ever decide to get into OS X or iOS development, having earned your wings in Eclipse will pay huge dividends later.
__________________
* I’m qualified to say this because I’ve lived and breathed vi for a living in the past.
** Remember, a lot of people are going back to school, learning or refreshing their programming skills.
*** You can write and compile Fortran 77 in Xcode with standard output, but you can’t access the Cocoa APIs and build native apps in F77.
CDT Downloads
All downloads are provided under the terms and conditions of the Eclipse Foundation Software User Agreement unless otherwise specified.
The CDT can either be installed as part of the Eclipse C/C++ IDE packaged zip file or installed into an existing Eclipse using the 'Install New Software...' dialog and entering the p2 repository URLs listed below.
CDT also provides its debugger as a stand-alone RCPapplication which can be downloaded and installed on its own. You can find more information about the Stand-alone Debugger on the Wiki.
CDT 9.8.0 for Eclipse 2019-06
Eclipse package: Eclipse C/C++ IDE for 2019-06.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/9.8
The git repo have been tagged with the CDT_9_8_1 tag. You can download the source from the web interface.
Archived p2 repos:
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/9.8/cdt-9.8.1/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/9.8/cdt-9.8.1/rcp-repository
CDT 9.7.2 for Eclipse 2019-03
Eclipse package: Eclipse C/C++ IDE for 2019-03.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/9.7
The git repo have been tagged with the CDT_9_7_2 tag. You can download the source from the web interface.
Archived p2 repos:
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/9.7/cdt-9.7.2/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/9.7/cdt-9.7.2/rcp-repository
CDT 9.6.0 for Eclipse 2018-12
Eclipse package: Eclipse C/C++ IDE for 2018-12.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/9.6
The git repo have been tagged with the CDT_9_6_0 tag. You can download the source from the web interface.
Archived p2 repos:
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/9.6/cdt-9.6.0/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/9.6/cdt-9.6.0/rcp-repository
CDT 9.5.5 for Eclipse Photon and 2018-09
Eclipse package: Eclipse C/C++ IDE for 2018-09.
Eclipse package: Eclipse C/C++ IDE for Photon.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/9.5
The git repo have been tagged with the CDT_9_5_5 tag. You can download the source from the web interface.
Archived p2 repos:
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/9.5/cdt-9.5.5/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/9.5/cdt-9.5.5/rcp-repository
CDT 9.4.3 for Eclipse Oxygen
Eclipse package: Eclipse C/C++ IDE for Oxygen.3.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/9.4
The git repo have been tagged with the CDT_9_4_3 tag. You can download the source from the web interface.
Archived p2 repos:
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/9.4/cdt-9.4.3/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/9.4/cdt-9.4.3/rcp-repository
CDT 9.3.3 for Eclipse Oxygen
Eclipse package: Eclipse C/C++ IDE for Oxygen.1.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/9.3
You can download the source from the web interface.
Archived p2 repos:
- CDT 9.3.2 was not released.
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/9.3/cdt9.3.3/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/9.3/cdt9.3.3/rcp-repository
CDT 9.2.1 for Eclipse Neon
Eclipse package: Eclipse C/C++ IDE for Neon.3.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/9.2
The git repo have been tagged with the CDT_9_2_1 tag. You can download the source from the web interface.
Archived p2 repos:
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/9.2/r.1/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/9.2/r.1/rcp-repository
CDT 8.8.1 for Eclipse Mars
Eclipse package: Eclipse C/C++ IDE for Mars.2.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/8.8.1
The git repos have been tagged with the CDT_8_8_1 tag. You can download the source from the web interface.
Eclipse Cdt Download For Mac
Archived p2 repos:
CDT also provides its debugger as a stand-alone RCP application which can be downloaded and installed on its own, from: http://download.eclipse.org/tools/cdt/releases/8.8.1/r/rcp
The RCP stand-alone debugger has its own p2 software repository to be used within the RCP itself to upgrade it: http://download.eclipse.org/tools/cdt/releases/8.8.1/r/rcp-repository
CDT 8.6.0 for Eclipse Luna
Eclipse package: Eclipse C/C++ IDE for Luna SR2.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/8.6
The git repos have been tagged with the CDT_8_6_0 tag. You can download the source from the web interface.
Archived p2 repos:
CDT 8.3.0 for Eclipse Kepler
Eclipse package: Eclipse C/C++ IDE for Kepler SR2.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/kepler
The git repos have been tagged with the CDT_8_3_0 tag. You can download the source from the web interface.
Archived p2 repos:
CDT 8.1.2 for Eclipse Juno
Eclipse package: Eclipse C/C++ IDE for Juno SR2.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/juno
The git repos have been tagged with the CDT_8_1_2 tag. You can download the source from the web interface.
Archived p2 repos:
CDT 8.0.2 for Eclipse Indigo
Eclipse package: Eclipse C/C++ IDE Indigo SR2.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/indigo
The git repos have been tagged with the CDT_8_0_2 tag. You can download the source from the web interface.
Archived p2 repos:
CDT 7.0.2 for Eclipse Helios
Eclipse package: Eclipse C/C++ IDE Helios SR2.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/helios
Archived p2 repos:
CDT 6.0.2 for Eclipse Galileo
Eclipse package: Eclipse C/C++ IDE Galileo SR2.
p2 software repository: http://download.eclipse.org/tools/cdt/releases/galileo
Archived p2 repos:
Development Builds
Development builds of the Eclipse C/C++ IDE can be found on the Eclipse Downloads page by clicking on the Development Builds tab.
Bleeding edge continuous builds are available from the cdt-master Jenkins build page and the p2 software repository: http://download.eclipse.org/tools/cdt/builds/master/nightly
Some older builds are available in the old CDT Nightly Build page.
Additional Distributions
The CDT can be installed as part of many commercial products or from the following open source distributions.
Linux
Most major Linux distributions include packages for Eclipse and the CDT. Check your package manager for availability.