gcc 3.2

Eva Brucherseifer eva at kde.org
Mon Oct 14 14:00:39 BST 2002


On Monday 14 October 2002 14:44, you wrote:
> Hi... all of you, just a litle more question.
> Where can I find some docs about the new C++ standar library?

It's actually not that new, but the very old and deprecated non-ANSI-standard 
stuff was removed from the libs. If you coded standard-conform before, the 
changes are very little ( in my code I only have to add a lot of "std::")

The ANSI C++ standard is active since 1998, so today all C++ book that are out 
there in the book stores (should) cover only the standard. The best known is 
probably Mr. Stroustroup's book.
If you are very good at the old C++ style, and want to learn about the 
reasoning of the ANSI comittee's changes, Mr. Kalev's book "ANSI/ISO C++" is 
very informative.

Greetings,
eva


>
> best regards
> Israel
>
> On Wednesday 09 October 2002 15:53, you wrote:
> > Hi Israel,
> >
> > gcc3 comes with a new version of the C++ standard lib, where several
> > things have changed due to standardization. Including <fstream.h>
> > should for example launch a note, that this include file is deprecated
> > and you should include <fstream> instead.
> >
> > Next thing: Name spaces. The standard C++ stuff all resides in a
> > namespace called std, so you can for example either write something like
> >
> >    std::cout << "blah" << std::endl;
> >
> > or place something like
> >
> > using std::cout;
> > using std::endl;
> >
> > at the top of your source (after the appropriate includes of course) and
> > leave the rest as is, i.e.
> >
> >    cout << "blah" << endl;
> >
> > As an alternative you can also do something like
> >
> > namespace std {
> >
> >       ... your code ...
> > }
> >
> > but that gave me some headache as all declarations in there will also
> > reside in the std namespace...
> >
> > Another more or less serious problem I faced is the disappearance of
> > fstream::attach(), which allows attaching a file handle to a stream. I
> > haven't got a solution for that right now (probably because I'm not a
> > streams/STL guru...). Some solutions provided in several docs mention,
> > that the stream constructor should be called with a file name as a 'const
> > char *' argument (among others), but that's no option for me because I
> > have to deal with sockets and pipes at that point and don't have any file
> > name - just the file handle. If someone has some sample code to work
> > around the missing attach() method, I'd be glad to take a look at it :-)
> >
> > Best regards,
> > Juergen
> >
> > Israel Ferández Cabera wrote:
> > > Hi this one is about gcc I guess. I use to work in RedHat 7.3 with gcc
> > > 2.9(something), but I upgrade my system to RedHat 8.0 and gcc 3.2. When
> > > I try to compile something done before I get a lot of error messages.
> > > 1. the c++ string type is not declare even if I #include <string> 2.
> > > the operator << is not defined for a fstream even if I #include
> > > <fstream.h> 3. the endl is not defined even when I have #include
> > > <iostream>
> > >
> > > any hint please?
> > >
> > >
> > > -
> > > to unsubscribe from this list send an email to
> > > kdevelop-request at kdevelop.org with the following body: unsubscribe
> > > »your-email-address«
>
> -
> to unsubscribe from this list send an email to
> kdevelop-request at kdevelop.org with the following body: unsubscribe
> ;your-email-address+


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list