Adding the CDT
If you intend to install the CDT (C/C++ Development Tools for Eclipse), BE SURE YOU’VE DOWNLOADED A 32 BIT VERSION OF ECLIPSE. There’s some sort of bug that has never been fixed in the 64 bit version that makes C++ not compile.
The CDT downloads page explains the install, but essentially you have two choices. You can download a fresh version of Eclipse with the CDT already included, or you can use the repository link. If you choose to go that route, copy the link, then open Eclipse and go to Help > Install New Software…. In the “Work with” box, paste the link and click “Add…” You can give the link a name if you wish. The CDT should pop up as a check box, as well as an optional tools checkbox. It’s up to you if you want just the CDT or the optional tools as well. Click the desired checkboxes and click Next, then follow the wizard from there and the software will install.
For the CDT to work you need the Command Line Tools, which are explained in the NetBeans Install Howto (scroll to “Installing the C++ Compiler”).
Before you can use the CDT, you have to select the C++ perspective: in the top right corner, there’s an icon that looks like a window. Hover on it and it says “Open Perspective.” You can use this to change between perspectives, including C++. It should also make a button so you can switch to C++ more quickly. Remember you have to change back to Java to write and compile Java code.
If you have the right version and are getting the error “Launch Failed: Binary Not Found” when you run the program, there’s one of two problems:
– You didn’t build before you ran the program. In the CDT, Eclipse does not build and run when you click the run button. Click Build and then Run.
– If you’re still getting that error, it’s most likely a problem with your toolchain. Create a new project and be sure “MacOSX GCC” is selected under Toolchains (sometimes it defaults to Cross GCC or something similar and that’s not what you want).