DIGIT-ARC read-only archive · snapshot: July 23, 2026

running c++ program in linux

14 posts · originally from https://geek.digit.in/community/threads/running-c-program-in-linux.22966/

S
shivi4 Original post #1
Jan 30, 2006 at 5:24 PM
i am very new to linux

using ubuntu os

i know only turbo c++ programs i want to run turbo c++
program in linux gnu

how do i know whether i have gnu software in my linux
Satissh S
Jan 30, 2006 at 7:27 PM
We have gnu compiler collection in GNU\Linux. Gcc is one of the most robust c compilers in the world. You can use it in place of turboc or if you need an IDE, use Anjuta. Use synaptic to install anjuta and start using it.
vignesh
vignesh #3
Jan 30, 2006 at 7:28 PM
Gcc is the compiler present in Linux...Install it using synaptic ...

Just select build-essential packages it will install gcc also...
S
shivi4 #4
Jan 30, 2006 at 8:56 PM
how to detect gcc in linux

and how to install
i dont know how to install in linux
vignesh
vignesh #5
Jan 30, 2006 at 9:28 PM
Open synaptic and install it by selecting on gcc....Search for it in synaptic if you can`t find it.
N
Jan 30, 2006 at 10:12 PM
shivi4 said:
how to detect gcc in linux

and how to install
i dont know how to install in linux

Open terminal and type "gcc" and press enter to see if it is installed, if it says command not found then it might not be installed.

gcc <filename>
eg: gcc shiv.c
Satissh S
Jan 30, 2006 at 10:23 PM
also give
$gcc --version
to get the version, since it's ubuntu 5.10 it might be 3.4 :roll: Just a guess.
S
shivi4 #8
Jan 31, 2006 at 6:19 PM
what is synaptic how to install that
S
shivi4 #9
Jan 31, 2006 at 6:21 PM
i am getting this
which guess i have gcc
but how to run c+ file
in the terminal

gcc (GCC) 3.3.4 (Debian 1:3.3.4-9ubuntu5)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
desertwind
Jan 31, 2006 at 6:21 PM
btw, he asked for a c++ compiler. gcc is gnu c compiler. try th following for a cpp file

g++ <filename.cpp>

after successful compilation

./a.out

for running the program
S
shivi4 #11
Jan 31, 2006 at 6:22 PM
i am writing this program as demo
#include<conio.h>
#include<iostream.h>
#include<stdio.h>
using namespace std;
int main()
{
cout<<"hello";
return 0;
}
S
shivi4 #12
Jan 31, 2006 at 6:25 PM
ok how to use other header files in gcc
vignesh
vignesh #13
Jan 31, 2006 at 7:01 PM
conio.h is not present in gcc... What other header files do you want to use...
praka123
praka123 #14
Feb 1, 2006 at 2:00 AM
Borland' C/C++ compiler's a little different eg graphics.h etc is not a defacto thus not present in g++.Now many books for eg Cpp for Dummies etc cites examples been compiled on using gcc either in Windows OS or Linux.In windows some minimalist gnu...mingw32 etc should be installed.