LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-02-2005, 12:17 AM   #1
jkmartha
Member
 
Registered: Apr 2005
Location: india
Distribution: Redhat 9
Posts: 66

Rep: Reputation: 15
c++ on linux .........how


hi everybody,
i am new to c++. I want to learn it on linux (fedora core - 2). Can anybody help me ...how to go ahead ? where to write the code, how to compile & how to run ? If any GUI based environment , it will b nice. Thanx
 
Old 07-02-2005, 12:44 AM   #2
xowl
Member
 
Registered: Jan 2005
Distribution: Slackware current (and others)
Posts: 188

Rep: Reputation: 30
U could look at
http://www.cplusplus.com/doc/tutorial/


Where?? anywhere

How??

g++ Name.cpp -o Name
 
Old 07-02-2005, 12:54 AM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
If you want an IDE, I think most people use Anjuta. The text editors vi and emacs can also be used as IDEs I've heard.

Without using an IDE, you can write code in a text editor and then save it as filename.cpp (where "filename" is any name you choose). Then, open up a terminal window and cd to the directory in which your file is stored. Typing "g++ filename.cpp" without the quotes will compile the source code and the executable will be called a.out. g++ is the GNU C++ compiler and you need to have the GCC packages installed on your system to be able to use it. To run it, type "./a.out", again without the quotes. If you want the executable to be called something else, such as simply "filename", you need to type "g++ filename.cpp -o filename". Read the man page for g++ by typing "man g++" at the $ or # prompts.

As far as learning the language itself: books and tutorials are the way to go I think. Google for some tutorials. For books, I'm sure others can recommend some too but here are 3:

Thinking in C++, Bruce Eckel - the link points to an online version of both volumes of Eckel's book. I'm not sure how good they are.

Sams Teach Yourself C++ for Linux in 21 Days, Jesse Liberty and David Horvath - I have this and found it a bit hard to follow.

ANSI C++: The Complete Language, Ivor Horton - again I have this book. It's not specifically for Linux, but I find that Horton explains things really well. It's a good book IMO.
 
Old 07-02-2005, 01:24 AM   #4
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
If you are using the KDE environment then I would suggest "kdevelop" as it is a complete development environment. It is a little daunting when you first start to use it. But I have happliy using it for a cuople of years now. I am an amateur programmer and it took me about a couple of weeks to get started properly with it.
A little perseverance will pay off.
Michael Johnson
 
Old 07-04-2005, 06:49 AM   #5
jkmartha
Member
 
Registered: Apr 2005
Location: india
Distribution: Redhat 9
Posts: 66

Original Poster
Rep: Reputation: 15
hi Michael Johnson,
on kdevelop, how to compile & execute ?
 
Old 07-04-2005, 07:28 AM   #6
dexterdongle
LQ Newbie
 
Registered: May 2005
Location: here now ...
Distribution: RAWHIDE
Posts: 4

Rep: Reputation: 0
the bruce eckel books from above post are of the highest quality for intermediate to advanced learners
beginners can start here too ...d
 
Old 07-04-2005, 08:04 AM   #7
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
There is a button bar directly above the tabs on the edit panel. Theleftmost blue square one says "Build Project" when you place the cursor above it. This will compile the source and create the executable. The blue circular gear to the right will execute the application.
 
Old 07-04-2005, 08:12 AM   #8
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
I suggest you also look at the help menu on kdevelop. This contains a good guide for using the application. You can skip to chapter 5 if you want to use c/c++ development.
I will be away for a day or 2 from now. Hopefully if you need more help someone else will see this and help you.
Good luck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration