PDA

View Full Version : Writing simple c++ in Eclipse, help please!




XheartcoreboyX
Sep 25, 2008, 09:24 AM
So, i need to write simple c++ programs in Eclipse for a c++ college's course, i have downloaded it, but don't understand how to write in c++..

Libraries i need are iostream.h and math.h

and is there anything i have to keep in mind when writing the program? do i have to write using std ?

thanks!



lee1210
Sep 25, 2008, 09:36 AM
Do you have to do it in eclipse? Is that class requirement?

If not, I would recommend, if the projects in the course are pretty small, to just use a text editor (There are a number of programmer's text editors available, both graphical and commandline), g++, and gdb. Learning that will serve you well in understanding what an IDE is doing under the hood.

At least eclipse is cross-platform, though I didn't download the ultra version that covers all of the different languages, etc., only Java. As such, I can't give specific instructions, but this thread:
http://ubuntuforums.org/archive/index.php/t-564333.html

links to this:
http://wiki.eclipse.org/CDT/User/FAQ#Creating_a_simple_Managed_C.2B.2B_Project_--_.22Hello_World_on_a_Windows_Platform.22

Which walks you through creating a project. A managed make project will abstract the whole build process from you, which is either good or bad depending on whether or not you actually want to know how things work.

-Lee

foidulus
Sep 25, 2008, 01:31 PM
if you really need an IDE, use XCode, comes with every mac and you can download the most up to date version from Apple's website.

wizard
Oct 6, 2008, 06:35 AM
The title says it all.

First; if you are programming in C++ what is with the *.h files?

Second; an intro to computer science course should have set you up to understand the building of a program.

Third; While I don't see Eclipse as being that much worst than XCode i do agree with the idea that it really pays in the long run to learn to program with a simple text editor and build a program from the command line. Back to Eclipse in many ways it is a better system than XCode, XCode is very easy to get into crash-a-matic mode. Of course updating Eclipse can do that for you two.

Fourth; we are assuming you are programming on a Mac, but it would really help if you spelt it out. Frankly, your post leaves people with the impression that you haven't even tried as there is no usable detail at all in the text.

Fifth; everybody has already mentioned that Mac OS comes with XCode and the associated development tools.

Finally as far as what to keep in mind when writing the program? Well you might want to consider why you are in the class in the first place.

Dave