April 5, 2008
WikiHow to create c++ projects in eclipse
#wiki
How to create c++ projects in eclipse
- Get eclipse. Eclipse comes with only the runtime binaries, the support for C/C++ (the C Development Toolkit) has to be installed as an update.
- In the “Help” menu select “Software Updates” and the “Find and Install…”. Select “Search for new features to install”, and then “Next >”. Leave “Ignore features not applicable to this environment” checked and de-select all update sites.
- Now select the “Callisto update site” and then “Next >”. It should connect to the Callisto update site and look for the newest version.
- Select the latest version of the “Eclipse C/C++ Development Tools”.
- In the next window, you will have to “accept” the license, and then select “Next ”.
- It will again show you an overview, which you can just accept and select “Finish”.
- It will warn you that the Eclipse CDT is an “unsigned feature”. But you can just ignore that and select “Install All”.
- Once you are in Eclipse, you are given an empty workspace. You now have to start a new project.
- To do so, select “File” / “New” / “Project…”. Expand the section “C++” and select “Managed Make C++ Project”, then click “Next >”. The difference between a STD and Managed is in Standart you have build your make file, the compiler doesn’t build it for you.
- On the next screen, you have to give your project a name. In this case, it will be “HelloWorld”, however, you may use any name you like. Leave the “Use default” in “Project Contents” checked.
- The next two settings about “Project Type” and additional settings are usually ok, click them if they are not clicked both. You can see above that your executable is going to be only for OS X.
- Accept when Eclipse tries to change your perspective to C/C++ settings.
Notes
- For a detailed information follow the tutorial from this link . Also Eclipse’s own tutorial is pretty straightforward.
- I couldn’t figure out why Eclipse doesn’t show up any Binary folder even when I save my project(build it) as opposed to the tutorial. Once I relaunch Eclipse I can see it is there. I am troubleshooting this, I will keep an update here. FIXME \
- The biggest problem with developing C/C++ in eclipse is, it doesn’t come with a code formatter. That means when you press apple+shift+f it doesn’t do anything. Check in thepreferences and you will see in the code formatter section, it says NONE. In order to fix this, I googled and came up with a Eclipse plugin called SmallIndent. Unfortunately it doesn’t work properly in Macs. I happened to extract Astyle(this is a code formatter that SmallIndent is based on) through fink and I eventually installed SmallIndent and able to show Astyle in the preferences of it but no go. It doesn’t work at all right now.
Continue Reading
Back to Archive