From: "Donald Xie" Newsgroups: comp.os.msdos.djgpp Subject: How to use Namespace? Date: Thu, 27 Nov 1997 11:16:02 +0800 Organization: iiNet Technologies Lines: 34 Message-ID: <65ip6t$8b$1@news.iinet.net.au> NNTP-Posting-Host: gothic76.nv.iinet.net.au To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi DJGPP Gurus, I'm new to djgpp with some fairly limited C++ knowledge. When I tried to compile the following program: +-- Test Program ---------- #include using namespace std; int main() { cout << "Hello world!" << endl; return 0; } +-- End of test program ---------- Command: gcc -Wall -c hello.cpp, I got the following error: hello.cpp:1: iostream: No such file or directory (ENOENT) Using #include without namespace works fine. Sure I've missed something here? The real problem is when I try to use STL string class, #include gives me the C string (char*) functions instead of the C++ string class while using #include in namespace std gives the above compile error. I've checked the documentation but could not find any reference to this. Could anyone tell me how this can be done please? Thanks in advance for all replys. Donald