C++ compiler in Linux

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Love_Daddy
Forum Commoner
Posts: 61
Joined: Wed Jul 10, 2002 6:55 am
Location: South Africa
Contact:

C++ compiler in Linux

Post 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:
User avatar
Love_Daddy
Forum Commoner
Posts: 61
Joined: Wed Jul 10, 2002 6:55 am
Location: South Africa
Contact:

Re: C++ compiler in Linux

Post by Love_Daddy »

P.S I was using Visual C++ in windows and now have to convert to redhat.
User avatar
Love_Daddy
Forum Commoner
Posts: 61
Joined: Wed Jul 10, 2002 6:55 am
Location: South Africa
Contact:

Post by Love_Daddy »

I have found it..
Compiling a program:

g++ prgm.cpp -o prgm

Executing

./prgm
Post Reply