gcc 3.2

Israel Ferández Cabera israel at seg.inf.cu
Mon Oct 14 13:44:53 BST 2002


Hi... all of you, just a litle more question.
Where can I find some docs about the new C++ standar library?

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«



More information about the KDevelop mailing list