LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to compile C++ program using Open Terminal (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-compile-c-program-using-open-terminal-807599/)

Shanki235 05-13-2010 09:53 AM

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.

TB0ne 05-13-2010 12:26 PM

Quote:

Originally Posted by Shanki235 (Post 3967079)
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.

johnsfine 05-13-2010 12:34 PM

Assuming you have g++ and supporting packages installed already:

Code:

g++ filename.cc -o filename
./filename


cola 05-14-2010 11:30 AM

Quote:

Originally Posted by Shanki235 (Post 3967079)
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]".


All times are GMT -5. The time now is 01:37 PM.