C++ Problem, Finally!!

Started by
26 comments, last by ALH 19 years, 6 months ago
The <iostream.h> header, along with lots of other headers ending in .h have been deprecated. You should be including the header files that do not have a .h at the end of them when possible. The exception to this is OS-specific header files such as <windows.h>
Advertisement
That's good to know, thanks!

ALH
Ok this must be wrong. Even when I just include iostream in the header file with no other code in the whole project I still get all the errors.

Does this mean that my iostream file is broken? I can't believe that it is so difficult to get a standard library to work!! Surely I can't have an error in my iostream? I doubt that I would have opened it up and changed anything...

Could somebody send me a 'working' version on iostream.h so that I can rule out this possibility.

Thanks in advance.

Mark Coleman

[Edited by - mrmrcoleman on October 1, 2004 4:39:18 AM]
Does look like your include files are borked.
Taking a look at XIOSBASE on line 106, it doesn't seem to recognise "streamsize" as a typedef. "streamsize" is typedeffed "int" in IOSFWD. Try copying that file from your MSVC CD to the appropriate include directory. For that matter, try simply reinstalling MSVC.
Kippesoep
Quote:Original post by Aprosenf
The <iostream.h> header, along with lots of other headers ending in .h have been deprecated.

Actually they can't be deprecated because they were never standard in the first place.

Quote:You should be including the header files that do not have a .h at the end of them when possible. The exception to this is OS-specific header files such as <windows.h>


It's not an exception. Whatever the people supplying headers choose to use as an extension, you have to use. So some libraries will have .h, others .hpp, others .hxx, etc.

The C++ standard headers don't have an extension. They acknowledge the possibility that the header doesn't necessarily exist in a file.
make a small example program

#include <iostream>int main() {    std::cout << "Hello, World!" << std::endl;    return 0;}
For anyone unsure about how to use namespaces, have a read of Migrating to Namespaces. With the original article that it is based upon written in 1999, we should all have migrated by now. Right?
Great articles Pete, in those 9 years or so of C/C++, I've never worked with namespaces worrying about platform compliances, not before learning it is a compliance itself. Living and learning always...

TIA,
ALH

This topic is closed to new replies.

Advertisement