LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-13-2010, 09:53 AM   #1
Shanki235
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
Smile How to compile C++ program using Open Terminal


Hello friends,
I had wrote a program in the vi editor using the command vi [filename.cc] in open terminal and now i need to compile n run it so can u pls tell me the syntax for the same.
 
Old 05-13-2010, 12:26 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,091

Rep: Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379
Quote:
Originally Posted by Shanki235 View Post
Hello friends,
I had wrote a program in the vi editor using the command vi [filename.cc] in open terminal and now i need to compile n run it so can u pls tell me the syntax for the same.
Spell your words out, and provide details. What version/distro of Linux are you using? And what exactly is "open terminal"??

A quick Google search would have turned up lots. You probably need either "gcc <file>", or "cc <file>", to compile it.
 
Old 05-13-2010, 12:34 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Assuming you have g++ and supporting packages installed already:

Code:
g++ filename.cc -o filename
./filename
 
Old 05-14-2010, 11:30 AM   #4
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,031

Rep: Reputation: 63
Quote:
Originally Posted by Shanki235 View Post
Hello friends,
I had wrote a program in the vi editor using the command vi [filename.cc] in open terminal and now i need to compile n run it so can u pls tell me the syntax for the same.
You can mark the thread as "[SOLVED]".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
open sudo terminal program in aix in c sachin.s.puri AIX 1 12-21-2009 08:22 AM
how to use one of the two installed compilers to compile a program in open suse11.1 sonu kumar Linux - Newbie 3 09-03-2009 09:27 AM
Running program from terminal with & does nothing, program stops DittoAlex Linux - General 1 10-05-2007 01:35 AM
Open a Terminal and run a program after Gnome boot. sirius56 Linux - Newbie 8 01-02-2007 07:39 PM
How to open programs in terminal without being stuck to the terminal?? brynjarh Linux - Newbie 6 07-07-2004 12:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:39 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration