running c++ program in linux

Status
Not open for further replies.

shivi4

Journeyman
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

Youngling
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

Wise Old Owl
Gcc is the compiler present in Linux...Install it using synaptic ...

Just select build-essential packages it will install gcc also...
 

vignesh

Wise Old Owl
Open synaptic and install it by selecting on gcc....Search for it in synaptic if you can`t find it.
 

naveenchandran

In the zone
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

Youngling
also give
$gcc --version
to get the version, since it's ubuntu 5.10 it might be 3.4 :roll: Just a guess.
 
OP
S

shivi4

Journeyman
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

Cyborg Agent
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
 
OP
S

shivi4

Journeyman
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;
}
 

praka123

left this forum longback
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.
 
Status
Not open for further replies.
Top Bottom