

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
1 message in net.sourceforge.lists.courier-users[courier-users] fstream response from...| From | Sent On | Attachments |
|---|---|---|
| dani...@tonservices.com | Apr 20, 2001 3:20 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | [courier-users] fstream response from IBM | Actions... |
|---|---|---|
| From: | dani...@tonservices.com (dani...@tonservices.com) | |
| Date: | Apr 20, 2001 3:20:39 pm | |
| List: | net.sourceforge.lists.courier-users | |
Sam, can this information be applied to fix the fstreams issue when compiling Courier with xlC on AIX? I have been trying some things with cmlm.C, like removing the .h on relevant include lines, but without success. I am more of a C tinkerer than a C programmer...
Hello Dan,
I found the following information about the differences between the two header files, <fstream> and <fstream.h>. This information is located in the on-line documentation for the AIX VisualAge C++ 5.0 compiler. Here is a brief summary; there are two different implementations of the Input/Output Streams library on AIX. One implementation is the new version that follows the ISO C++ Standards. The other implementation is for compatibility with older code and it does not follow the new standards.
<fstream> - Header providing an interface to the new library that follows the ISO C++ Standard <fstream.h> - Header providing an interface to the old library that does not follow the ISO C++ Standard
So it appears that the Courier Mail system should be compiled on AIX using the <fstream> header rather than the <fstream.h> header. If you use the <fstream> header, then you will not need to modify those lines of code containing the is_open() method.
---------- Considerations When Using C++ I/O
Two implementations of the iostreams input/output library are included in VisualAge C++, Version 5.0:
The first implementation conforms to the specification of the iostreams library as it appears in the ISO C++ standard. Types and functions associated with this implementation are declared in the standard header files <iosfwd>, <iostream>, <ios>, <streambuf>, <istream>, <fstream>, <ostream>, <iomanip>, <sstream> and <strstream>. Use this implementation of iostreams for conformance to the C++ standard, or when using other components of the Standard C++ Library. The second implementation is provided for compatibility with versions of VisualAge C++ prior to Version 4.0. Types and functions associated with this implementation are declared in the non-standard header files <iostream.h>, <fstream.h>, <iomanip.h>, <strstream.h>, <stream.h> and <stdiostr.h>.
The standard iostreams library declares all names in the standard namespace std, while the compatibility iostreams library declares all names in the global namespace. In a project that uses both iostreams implementations, if the using-directive using namespace std; appears in any scope that encloses the use of a name which is declared by both implementations of iostreams, a compile-time error will result.
Example
#include <iostream> #include <iostream.h>
using namespace std; // Line 1 int main(void) { cout << "I can hear music\n"; // Line 2 - which cout? }
The header file <iostream> declares the static object std::cout and the header file <iostream.h> declares the static object ::cout. Because of the using-directive at line 1, both of these objects will be considered when name lookup attempts to resolve the identity of the cout named at line 2. The compiler will halt with a diagnostic message. If the using-declaration at line 1 is deleted, the source of ambiguity is removed and the example will compile successfully. The cout named at line 2 will then resolve to the compatibility iostream library's cout, which is declared in the global scope in the header file <iostream.h>.
It is possible to use the two implementations of iostreams together.
---------- Chris Shortes IBM AIX Support - Programming Languages







