An IDE for C/C++ developers with Mylyn integration. Maintained by: Eclipse Packaging Project. Mac OS X (Cocoa) 32-bit Mac OS X (Cocoa) 64-bit. What are the best IDEs for C++ on Mac OS X? Your project works well; people have been using Eclipse CDT because of the missing 'refactor C++' on Xcode.
Nowadays, it seems that the Eclipse C/C Development Tools (CDT) is quickly becoming a de-facto standard especially for Embedded Development. As points out, this is mainly the result of the efforts of embedded tools vendors or RTOS vendors, who have extended the CDT for cross-development environments with remote target debugging and the like. Recently I’ve worked with Eclipse-based Nucleus EDGE from Mentor Graphics as an embedded IDE with Microtec compilers for a ColdFire target and was quite pleased with the overall development environment (comparing this to the old Nucleus EDE some years ago which was a set of macros to be imported in Microsoft Visual Studio 6, which led me to use vim and make on Cygwin as my main development tools.
Btw, if you are like me and vim is indispensable to you, then you can add vi functionality to Eclipse with – this one is commercial, but there exists other plugins as well). Now, as I’ve had some time to spend on my Macbook Pro, I wanted to know what the “vanilla” Eclipse CDT from www.eclipse.org has to offer for building self-hosted C/C applications with standard GNU C/C tools (the Apple GCC 4.0 compiler in that case). As example source code I decided to use the famous rotating 3-D gear wheels from Brian Paul that has been converted to GLUT.
The source code is in the public domain and can be found. $ gcc -version i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. Build 5367) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. On Mac OS X the OpenGL Utility Toolkit (GLUT) can be installed with. $ sudo port install glut Then compile the program with $ gcc -Wall -I/usr/X11R6/include/ -I/opt/local/include -L/opt/local/lib -L/usr/X11R6/lib -lglut -lglu -lgl -o gears gears.c Looks familiar, no?
П™‚ Now, on to the installation of the CDT release for Europa based Eclipse. CDT 4.0 runs with Eclipse 3.3 and is part of the Eclipse Europa simultaneous release. I’ve installed CDT 4.0.2 by entering the URL in the Eclipse update manager to download the CDT features. First open the C/C perspective Then create an empty C project and select the Apple GCC toolchain.
Add the include directories /opt/local/include and /usr/X11R6/include in the project properties. Now the required libraries need to be added to the linker settings. After successful compilation, you will probably want to run the gears application, but you’ll see the following error message in the console GLUT: Fatal Error in gears: could not open display: This can be fixed by adding the display variable to the environment Now you should be able to compile and run the gears application from Eclipse CDT in Mac OS X. For real on some mac systems it keeps complaining about libraries in the linker thing. Always a ‘library not found for -lXXX’ e.g.lglut for some insane reason! Everybody on every website says this works and I have been on it for days but its not working.
I even tried it on command line using the following gcc -Wall -IincludesOpenCV/ -LOpenCV/lib/ -lcv -lhighgui -lcxcore -o try main.cpp The /lib directory contains files cv.lib, highgui.lib and cxcore.lib. I have also tried.a files as well Anyone know if theres something somewhere else in the eclipse settings that is preventing it from working? I will really appreciate your input.
I am using a macro, lion os, 64 bits if that adds anything.
This article, which is a follow-up to ',' is intended for C developers who want to learn C development using the Eclipse CDT. A simple C application is developed in the article.
The application makes use of the C STL. Readers should be familiar with the STL, as well as with basic object-oriented programming principles such as inheritance and polymorphism. A familiarity with Eclipse will be helpful, but is not required. Before we start You need to install the following:. We're using the CDT, which is a plug-in to Eclipse, so of course you need Eclipse. The article uses Eclipse V3.2. Java Runtime Environment We're building a C application, but we're using Eclipse.
Eclipse is a Java application itself, so it needs a Java Runtime Environment (JRE). The article uses Eclipse V3.2, which requires a JRE of V1.4 or higher. If you want to also use Eclipse for Java development, you'll need a Java Development Kit (JDK). This article is about the CDT, so you'll need it, of course. For instructions on installing the CDT on early versions of Eclipse, read a ' (developerWorks 2003). If you're using Microsoft Windows®, you will find Cygwin — which provides a Linux®-like environment on Windows — helpful.
GNU C/C Development Tools The CDT uses the standard GNU C/C tools for compiling your code, building your project, and debugging the applications. These tools are GNU Compiler Collection (GCC) for C (g), make, and the GNU Project Debugger (GDB). If you're a programmer using Linux or Mac OS X, there's a pretty good chance these tools are installed on your machine. The article contains instructions for setting up these tools for Windows. The Eclipse CDT The Eclipse CDT is an Eclipse plug-in that transforms Eclipse into a powerful C/C IDE. It was designed to bring many of the great features Eclipse enjoyed by Java developers to C/C developers, such as project management, integrated debugging, class wizards, automated builds, syntax coloring, and code completion. When Eclipse is used as a Java IDE, it leverages and integrates with the JDK.
Similarly, the CDT leverages and integrates with standard C/C tools, such as g, make, and GDB. This has lead to it becoming very popular on Linux, where those tools are readily available and used for most C development. The CDT can be set up on Windows to use the same tools. There is also an ongoing effort to get the CDT to work with Microsoft's C tools to make it even more attractive to Windows C developers.
Installing the CDT We start by assuming you installed Eclipse and can run it. If not, consult Eclipse's Web site for getting up and running. Let's install the CDT.
The CDT is an Eclipse plug-in, so it uses Eclipse's Software Updates feature. Select Help Software Updates Find and Install. Eclipse Software Updates. After you finish installing CDT, you'll be asked to restart Eclipse. Go ahead and do that. Once Eclipse restarts, the CDT will be ready to go. Windows configuration If you're running Eclipse on Linux or Mac OS X, you're ready to start using the CDT to develop a C application.
If you're on Windows, there might be a few more steps. As mentioned, CDT relies on the standard GNU C development tools: g, make, and GDB. These are usually included on Linux or Mac OS X. They're usually not included with Windows.
But don't worry. These tools can be easily installed on Windows. Perhaps the easiest way is to install Cygwin. Cygwin provides Linux-like environment on Windows (see ). When installing Cygwin, you'll be asked to pick the packages you want to install.
Make sure to go into the development section and select gcc: g, make, and GDB. This will cause their prerequisites to be installed, too. Once you're done installing Cygwin, you'll need to add g, make, and GDB to your path. The easiest way to do this is to add Cygwin's bin directory to your path, since that's where g, make, and GDB can be found. Once that's done, restart Eclipse. Playing the lottery At this point, we should be ready to start developing our application with CDT.
Let's pause to figure out what we want to develop. The sample application is a simple command-line program for generating lottery numbers. Many states have lotteries, and the rules vary quite a bit. We'll allow the user to pick which state lottery he wants to generate numbers for. This will provide us a good way to use C's support for polymorphic behavior. Creating the project Eclipse uses the concepts of perspectives to allow for various plug-ins to customize their commands and views.
Eclipse starts off by default in the Java perspective. CDT includes its own perspective, so we'll want to switch to that. To do that, select Window Open Perspective Other. You should see a list of perspectives available to you.
Select the C/C perspective and click OK. Select C/C perspective. Related topics. (Alex Ruiz, developerWorks): Learn how to execute C/C code analysis tools with Codan in Eclipse. Get an overview of the CDT in '.' . Dig deep into the CDT's architecture in the five-part series titled '.'
. As someone interested in C/C development, you might want to check out a trial of IBM's. Windows developers can learn about migrating to the CDT in '.' .
Windows developers can also check out the, a project for incorporating Microsoft's compiler and debugger with CDT. Learn about, the GNU C/C tools for Windows included with Cygwin. Download a Linux-like environment for Windows. It consists of two parts: A DLL that acts as a Linux API emulation layer providing substantial Linux API functionality and a collection of tools that provide a Linux look and feel.
The download information contains the latest information about the available versions of CDT. Check out the '.' . For an introduction to the Eclipse platform, see '.'