From: Suvanpong, P. <ps210007@Exchange.Australia.NCR.COM> - 2002-10-01 01:04:58
|
#include <iostream> using namespace std; #include <iostream> int main(int argc, char **argv) { cout << "Hello" << endl; return (0); } try the above code. psksvp -----Original Message----- From: e hughes [mailto:eh...@ma...] Sent: Tuesday, October 01, 2002 10:58 AM To: min...@li... Subject: [Mingw-users] newbie problems: cout, endl synopsis: attempted to compile a simple Hello World in c++ using g++ and having set paths, etc. appropriately (as far as I can tell, having looked through every resource available to me at no cost..., including archives, which mention similar problems but have inapplicable solutions) source: #include <iostream> int main(int argc, char **argv) { cout << "Hello" << endl; return (0); } errors received: first.cpp: In function `int main(int, char**)': first.cpp:4: `cout' undeclared (first use this function) first.cpp:4: (Each undeclared identifier is reported only once for each function it appears in.) first.cpp:4: `endl' undeclared (first use this function) The C version of Hello World works correctly with MinGW gcc, so I think the problem lies somewhere in the iostream header or with g++, as opposed to the instalations of either MinGW or CygWin background info: recently installed Cygwin and MinGW in an attempt to build a decent working environment for coding c++ apps. I've previously used Borland, VC++, and gcc from within Mandrake without problems. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ MinGW-users mailing list Min...@li... You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users |