gcc 3.2

Juergen Suessmaier juergen at suessmaier.de
Wed Oct 9 20:53:37 BST 2002


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«

-- 
-------------------------------------------------------------------------
J. Süßmaier Systementwicklungen
Jürgen Süßmaier
juergen at suessmaier.de                       Realtime Software Development
Katharina Geisler Str. 14                       Embedded Applications
D-85356 Freising                                     Automation
Germany
-------------------------------------------------------------------------
                       http://www.suessmaier.de
-------------------------------------------------------------------------
       The day Microsoft makes something that doesn't suck is
         probably the day they start making vacuum cleaners
-------------------------------------------------------------------------


-
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