LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-24-2003, 08:02 AM   #1
gtgoku
Member
 
Registered: Jul 2003
Location: India
Distribution: Slackware 10; FreeBSD 4.10
Posts: 77

Rep: Reputation: 15
Question c++ programming in linux


I need to know how to program in c++ in linux in windows i used to use turbo c++ ver 3.0, but now i have slackware 9 and wanna know how to program cpp files,
for ex where to type in the code, hot to compile the code and how to run the compiled file.

Please help me
 
Old 10-24-2003, 08:29 AM   #2
sNicker
Member
 
Registered: Oct 2003
Location: Italy
Distribution: Slackware 9.1, Slackware 10
Posts: 33

Rep: Reputation: 15
well, in linux a C++ compiler is installed by default: G++

You can edit your source files with any text editor you want (I prefer those with syntax highlighting like kate or nedit), then from command line you only need to type

g++ source.cpp -o binary.name

this will compile and link your source file (source.cpp), giving to the resulting binary the name "binary.name" (you can choose any name you want).

For further informations (and there are many...) type "man g++" and/or google a little bit around

Ah, to launch you binary you need to type "./binary.name" and voilà!

good luck
 
Old 10-24-2003, 08:43 AM   #3
aizkorri
Member
 
Registered: Feb 2002
Location: Basque Country
Distribution: Fedora 14, Ubuntu 14.04
Posts: 434
Blog Entries: 1

Rep: Reputation: 55
I find easier to use emacs.
when you want to compile just click tools->compile and type what sNicker said. You'll see the error messages right there in another window below the text.
 
Old 10-24-2003, 09:07 AM   #4
Anteneh
LQ Newbie
 
Registered: Oct 2003
Location: Ethiopia
Distribution: Red Hat
Posts: 4

Rep: Reputation: 0
check it out at
http://www.advancedlinuxprogramming.com/
I found this book verry helpfull. You can even dowen load it for free. //Enjoy your C++
Best regards// Ant
 
Old 10-24-2003, 09:26 AM   #5
sNicker
Member
 
Registered: Oct 2003
Location: Italy
Distribution: Slackware 9.1, Slackware 10
Posts: 33

Rep: Reputation: 15
I have to study that book... it looks nice!!
 
  


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
Difference between Top Down programming & Bottom up programming minil Programming 1 06-17-2005 02:42 AM
New Forum for Linux-Gurus[Programming/Administration] or Linux-Advanced Users [ Progr raees LQ Suggestions & Feedback 5 04-12-2005 07:35 PM
C/C++ programming for linux leeman_s Linux - General 6 01-28-2003 06:16 PM
Exp. Windows/Linux-Script Programmer - Need Linux Programming Mentor! ruttiger Linux - Newbie 2 10-28-2001 11:00 AM
New to Linux programming .... need help Izhar Programming 2 10-17-2001 03:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12: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