This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

mingw32 and stdiostream


Starting a couple of snapshots ago, I've been unable to build a
cross-compiler on Linux with glibc-2 for mingw32. The problem is in libio:


+ /usr/src/devel/gcc/i586-inX-linux.to.mingw32/gcc/xgcc -B/usr/src/devel/gcc/i586-inX-linux.to.mingw32/gcc/ -c -march=pentium -malign-double -pipe -O6 -fno-keep-static-consts -fno-implicit-templates -I. -I../../../libio -nostdinc++ -g ../../../libio/stdiostream.cc
../../../libio/stdiostream.cc: In method `stdiobuf::stdiobuf(struct FILE *)':
../../../libio/stdiostream.cc:55: `fileno' undeclared (first use this function)
../../../libio/stdiostream.cc:55: (Each undeclared identifier is reported only once
../../../libio/stdiostream.cc:55: for each function it appears in.)
make: *** [stdiostream.o] Error 1


I assume that there are other people building the same cross-compiler in a
similar environment, so this may be something unusual about the setup here.

At any rate, I've resolved it for my purposes by including the io.h header
that I'm using with mingw32, which has a definition of fileno(), which is
not in stdio.h here. I haven't done any real testing yet to see if this
actually fixes the problem, but I can't see any reason why it wouldn't. I
never use stdiostreams intentionally, although it may be that they are used
behind the scenes for standard I/O for all I know.



Index: libio/stdiostream.h
--- inX.25/libio/stdiostream.h Tue, 26 Aug 1997 10:35:13 -0700 tmwg (gcc/A/35_stdiostrea 1.1 640)
+++ egcs.29(w)/libio/stdiostream.h Sun, 19 Jul 1998 07:32:13 -0700 tmwg (gcc/A/35_stdiostrea 1.1 640)
@@ -33,6 +33,9 @@
 
 #include <iostream.h>
 #include <stdio.h>
+#ifdef __MINGW32__
+#	include	<io.h>
+#endif
 
 extern "C++" {
 class stdiobuf : public filebuf {


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