View Full Version : Programming C++ with Red Hat
PJYelton
10-28-2002, 11:22 AM
I'm very new to Linux, and have recently installed Red Hat onto my computer and am using the GUI. What do I need to do or download so that I can write my C++ programs again? I used MS Visual Studio and Bloodsheds Dev C++ when using Windows so I would prefer some type of GUI interface. The only things I've found on the internet so far have been dead links, and since the internet connection is SOOOOO slow, I was hoping someone could help me here... Thanks! :D
starX
10-28-2002, 11:37 AM
I'm willing to bet you don't need to download anything. On a command prompt, try:
g++ --version
If you get some kind of number returned, then that means that g++ was included with the iunstall of your system (it usually is). To compile a program using g++, use:
g++ -o mycode.exe mycode.cpp
Where mycode.exe is the name of the executeable (this part is optional), and mycode.cpp is the name of the source file.
If you don't give a "-o mycode.exe", then your executeable will be named "a.out". To run these (at command line), "./mycode.exe".
To write your code, you'll be wanting to use a text editor like emacs or vi (or maybe one of their graphical counter parts. try "gvim" or "xemacs" on the command line and play around, see which one you prefer. If you don't get those, try "emacs" or "vim", which are basically the same as their above graphical counterparts, but without all the fancy menus and such.
If you'll be doing any debugging, when you compile your code, issue a "-g" right before the "-o mycode.exe", and then run ddd (graphical) or gdb (command line) from the command line to start debugging your code. If you don't include the "-g" option, then you'll have a harder time debugging.
If there's anything else you want to know, try "man command" where command is the name of a program that you want to execute. This will display the manual page entry (if it exists) for that command.
Best of luck,
starX
www.axisoftime.com
Fredd
10-28-2002, 11:38 AM
You could try kdevelop it's a pretty cool IDE for linux(sorry... dont have the url) but i think, not sure though, that there is a linux port of Dev C++. otherwise i recommend emacs and gcc :)
Try http://freshmeat.net or http://sourceforge.net/ for linux programs
PJYelton
10-29-2002, 09:44 AM
OK, thanks, I got KDevelop up and working and I did find out how to use g++. Took awhile to get used to both of them, still having problems, but they should get weeded out soon. I downloaded Dev-C++ for Linux but I don't know how to make it work!! I'm such a Linux newbie, I have no idea how to run a program, I'm so used to running a setup.exe file in windows. The file I downloaded is called "dev-src_Jul_30_23h03.tar.gz" but doesn't run if I click on it, and the download website made it look like this was the only file I needed. Any advice for a complete newbie? My Unix/Linux book definately does not cover this...
PJYelton
10-29-2002, 10:42 AM
OK, thanks, I'll give that a try when I'm on my Linux comp tonight. I've got a question though, I've been browsing around sourceforge.net and almost all of the files to download there are listed as .tar.gz files. How do I run this type of file normally or am I looking in the wrong place and need to download something else thats the equivalent of a .exe file?
PJYelton
10-29-2002, 01:36 PM
Thanks, you've given me enough information to probably figure out everything else on my own. Unfortunately I don't have any manuals since this is for my Unix/Linux class that I have at night on a lab computer who's installed manual takes 15 minutes to move from page to page... I'm way ahead of the class in terms of the lecture (the teacher is still teaching how to use 'cat' and 'cd'!) but nowhere near the point where I can do my own stuff except play the same preinstalled games over and over again. And searching the internet only found me websites for advanced users - of course that's probably mostly because I couldn't think of the right search words! :D Thanks for the help!
Fredd
10-29-2002, 03:41 PM
check out www.tldp.org
well.. thats a part of the linux glory.. figuring stuff out and trying to make it work. just play around with it, try stuff out, it ain't that hard expecially since you are running Red Hat :p :rolleyes:
PJYelton
10-30-2002, 09:59 AM
Thanks! That website looks great and exactly what I needed! Growing up with nothing but windows has made things challenging, but interesting. Kinda like going to a different country for the first time and realizing that not everyone lives the same way you do! :D
Fredd
11-01-2002, 11:05 AM
Great! :)
Good luck and welcome to a blue screen free world :D
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.