Page 1 of 1

C++ compiler in Linux

Posted: Thu Mar 13, 2003 7:51 am
by Love_Daddy
Hi Guys,

Can anyone tell me how I compile a C++ program in linux.

I have tried:

g++ prgm.cpp -o -Wall prgm and
g++ prgm.cpp -o prgm

and it does not work properly..

After I compile it, I get prgm as an executable, but when I click it, it does nothing, only tells me that
¨bash: prgm: command not found¨

Oh! - and what about the program contents.. I have

#include <iostream>
int main ()
{
cout << ¨Hello world¨<<endl;
return 0;
}

Is there something wrong with this code?

What do I have to do for it work properly..

:oops:

Re: C++ compiler in Linux

Posted: Thu Mar 13, 2003 8:03 am
by Love_Daddy
P.S I was using Visual C++ in windows and now have to convert to redhat.

Posted: Thu Mar 13, 2003 8:12 am
by Love_Daddy
I have found it..
Compiling a program:

g++ prgm.cpp -o prgm

Executing

./prgm