This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Where is 'ios'/'ios_base'?


On Wed, Feb 14, 2001 at 09:59:16AM +0900, Steve Frampton wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello:
> 
> I'm using g++ with libstdc++ 2.96-69 (courtesy of Red Hat), and I was just 
> wondering if the "ios" header file is missing?
> 
> I'm using a stringstream with which I'd like to throw an exception if the 
> failbit/badbit is set.  I have:
> 
>   #include <iostream>
>   #include <sstream>
>   using namespace std;
> 
>   stringstream ss;
>   ss.exceptions(ios_base::badbit | ios_base::failbit);
> 
> But on compilation I get:
> 
>   demo.cpp:25: `ios_base' undeclared (first use this function)

This error does not occur with the version of gcc in CVS.
You may wish to upgrade your compiler (2.96-74 is the latest from Redhat).

If you do:
rpm -ql libstdc++
rpm -ql libstdc++-devel

This will list the libraries and header files that came with your
Redhat distribution of the Standard C++ library.  It looks
like the Redhat distribution does not come with <ios>, but
it does come with <iosfwd>.  You can try that.

For general C++ questions, it is best to post them to the newsgroup
comp.lang.c++.moderated.
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]