On Thu, Oct 17, 2002 at 06:10:23PM -0600, Aly Dharshi wrote: > #include <iostream> > > int main() > { > cout << "Testing 1 2 3 ... \n"; > return 0; > } > > > Tried compiling this simple program and can't understand why the error, > system produces the following errors: > > test_cc1.cc: In function `int main()': > test_cc1.cc:5: `cout' undeclared (first use this function) > test_cc1.cc:5: (Each undeclared identifier is reported only once for > each > function it appears in.)
try compiling it with g++ instead of gcc. Its a C++ program, not a 'C' program. Leastways, it works on my system. RH 7.2 cat foo.cpp ====================================================================== #include <iostream> int main() { cout << "Testing 1 2 3 ... \n"; return 0; } [jkinz@redline jkinz]$ g++ foo.cpp [jkinz@redline jkinz]$ ./a.out Testing 1 2 3 ... ====================================================================== -- Jeff Kinz, Emergent Research, Hudson, MA. "[EMAIL PROTECTED]" "[EMAIL PROTECTED]" copyright 2002. Use is restricted. Any use is an acceptance of the offer at http://users.rcn.com/jkinz/policy.html. (o- -o) //\ eLviintuaxbilse /\\ V_/_ _\_V -- redhat-list mailing list unsubscribe mailto:redhat-list-request@;redhat.com?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list