Programming C++ with Red Hat

This is a discussion on Programming C++ with Red Hat within the Linux Programming forums, part of the Platform Specific Boards category; I'm very new to Linux, and have recently installed Red Hat onto my computer and am using the GUI. What ...

  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Programming C++ with Red Hat

    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!

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    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

  3. #3
    Registered User Fredd's Avatar
    Join Date
    Oct 2002
    Posts
    69
    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
    "Writing software is more fun than working."

    got slack?
    http://www.slackware.com/

  4. #4
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    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...

  5. #5
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    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?

  6. #6
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    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! Thanks for the help!

  7. #7
    Registered User Fredd's Avatar
    Join Date
    Oct 2002
    Posts
    69
    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
    "Writing software is more fun than working."

    got slack?
    http://www.slackware.com/

  8. #8
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    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!

  9. #9
    Registered User Fredd's Avatar
    Join Date
    Oct 2002
    Posts
    69
    Great!

    Good luck and welcome to a blue screen free world
    "Writing software is more fun than working."

    got slack?
    http://www.slackware.com/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem: online on winxp and linux red hat
    By gemini_shooter in forum Linux Programming
    Replies: 5
    Last Post: 05-29-2005, 03:14 PM
  2. Can Skype on Red hat 9.1
    By xxxrugby in forum Tech Board
    Replies: 2
    Last Post: 03-25-2005, 11:26 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  4. Got a Job !! (Red Hat)
    By Perspective in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 03-03-2004, 09:11 PM
  5. Replies: 3
    Last Post: 10-29-2003, 09:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21