|
From: <or...@vp...> - 2003-02-25 13:09:29
|
Vlada Djurovic wrote: > #include <iostream> > #include <stdlib> > using namespace std; > I get error like "stdlib: No such file or directory". > > When I write like this: > #include <iostream> > #include <stdlib.h> > using namespace std; > > everything is fine. I thought that with "using namespace" you don't have > specify file extension. No, I think this is not correct this way. I would rather say: when you don't use extensions, you MUST use namespaces. > Why does the compiler complain only about stdlib > without .h? Can somebody please explain this? The compiler complains, because there is no "stdlib" file. "stdlib.h" instead is part of C, not C++. If you look into <MINGW_DIR>/include/c++/3.2 you won't find any stdlib or stdlib.h files. It is in /include. Another little note: If you look into <MINGW_DIR>/include/c++/3.2 you will notice, that the files there don't have extensions. They have namespaces. But in <MINGW_DIR>/include/c++/3.2/backward they have extensions (kept for backward compatibility). -- Greetings, Balázs |