compiling and running procedure for c++ programs

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
Lance Naik
Posts: 21
Joined: Tue Jul 12, 2005 2:01 pm

compiling and running procedure for c++ programs

Postby raza » Thu Jul 21, 2005 3:59 pm

Hi dears ,
can anybody help k how to compile and run a C++ program in red hat 9 with small example of hello world program. I think there is something to take care about header extension or any thing else.

following is the program i tried but getting error messages only

[root@linux root]# g++ -c -g -O `iostream' was not declared in this scope syntax error before `using' In function `int main()': `cout' undeclared (first use this function) (Each undeclared identifier is reported only once for each
function it appears in.)

how to solve the problem



Battalion Quarter Master Havaldaar
Posts: 228
Joined: Fri Jan 28, 2005 6:23 pm
Location: Karachi

always paste code :)

Postby AsadRasheed » Thu Jul 21, 2005 5:24 pm

include <iostream.h>
#include <stdio.h>


cout << "raza is g++ master \n";


always paste code when u ask question regarding some codeing error.

$g++ -o test
raza is g++ master

Lieutenant Colonel
Posts: 691
Joined: Mon Oct 13, 2003 9:40 am

Re: always paste code :)

Postby jargon » Thu Jul 21, 2005 5:49 pm


Anjum Butt
Company Havaldaar Major
Posts: 165
Joined: Mon Jun 09, 2003 9:02 am
Location: Karachi

Postby Anjum Butt » Fri Jul 22, 2005 4:53 am

More will follow :)

Anjum Butt
Registered Linux User #314299

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest