This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC3 problems with C++ fstream


On Mon, Aug 12, 2002 at 06:48:02PM +0200, Gerrit P. Haase wrote:
>Hallo,
>
>Code:
>=====
>#include <fstream>
>void main() //the program starts here
>{
>ofstream SaveFile("cygwin.txt");
>SaveFile << "Hello World, this works with gcc-2 but not with gcc-3!";
>SaveFile.close();
>}

Funny, this program doesn't even compile for me.  However, if I change
fstream to fstream.h, I get a big warning about using a deprecated header
file and it links/runs fine.

I don't know why you're searching /usr/include/g++-3.  That directory should
have been deleted with recent test versions of gcc 3.x however, I see
that I have it on my system too.  I thought that was due to my gcc testing.

Possibly removing it will cause g++ to work as expected.

cgf

>GCC3:
>=====
>$ g++ --version
>g++ (GCC) 3.1.1 20020718 (prerelease)
>
>$ g++ -o fstream fstream.cpp
>In file included from /usr/include/g++-3/streambuf.h:36,
>                 from /usr/include/g++-3/iostream.h:31,
>                 from /usr/include/g++-3/fstream.h:30,
>                 from /usr/include/g++-3/fstream:6,
>                 from fstream.cpp:1:
>/usr/include/g++-3/libio.h:30:23: _G_config.h: No such file or directory
>In file included from /usr/include/g++-3/streambuf.h:36,
>                 from /usr/include/g++-3/iostream.h:31,
>                 from /usr/include/g++-3/fstream.h:30,
>                 from /usr/include/g++-3/fstream:6,
>                 from fstream.cpp:1:
>/usr/include/g++-3/libio.h:239: '_G_off_t' is used as a type, but is not 
>   defined as a type.
>/usr/include/g++-3/libio.h:279: `read' was not declared in this scope

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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