Subject: ostream, ftw question
From: [email-masked] (Walter Prins)

12 Nov 1996 20:17:19 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked]
Original-Sender: [email-masked]

Hi

I have only recently found out about the CygWin32 project.  Anyway, I
downloaded the b16 cdk, and built a cross to Win32 cross compiler with
gcc-2.7.2.1 on my Redhat linux 4.0 box.  The compiler seems more or
less fine, and I can compile the example programs by hand (though not
via make -- the makefiles have not been set up, and I have not had
time to figure out how to get configure (?) to do this or why it
has not been done already when I did a global configure.  I suppose
that the examples are not really part of the tools.) I also successfully
recompiled all the major libraries of LEDA-3.3.1 (LEDA = the Library
of Efficient Datastructures and Algorithms.)

However, I have another program which I also developed under Linux,
which I have also compiled succesfully under DJGPP for dos.  I tried
to do the same under CygWin32, thinking that it should not be too 
much of a problem, but not so. I ran into a number of problems:

1) getopt.h is missing. "Fixed" it by adding it from my Linux native
gcc setup...  Probably a Bad Idea.

2)	strings.h is missing. OK, so it should be string.h, but my Linux
setup has a strings.h which just includes string.h.  Fixed it by
adding it from my Linux gcc setup.  Probably an OK idea...

3) ftw.h is missing. I could find no reference to ftw anywhere in the
cdk, yet this compiles fine on Linux, as well as for example DJGPP.
I can only assume that this is part of something which hasn't been
properly ported/converted? I have written my own ftw stub for the
time being. Not a very practical idea...

4) I have some
	_IO_ostream_withassign ostr=cout;
declarations in my code. Elsewhere, depending on conditions, i do
something like:
	fstream fstr; fstr.open(...);  ...
	ostr = fstr;
This works..
Initially however, if instead of preinitializing the variable ostr like
the above I do:
	_IO_ostream_withassign ostr;
	...
	ostr = cout;
.... the compiler complains thusly:
/usr/local/include/g++/streambuf.h: In method `class ostream &
ostream::operator =(class ostream &)':
/usr/local/include/g++/streambuf.h:118: method `class ios & ios::operator
=(class ios &)' is private
xlate2.cpp:181: within this context
This works on Linux and DJGPP. Why does it produce the above? Or am I
missing something painfully obvious?  (The line in the include file 
which is responsible for this has "Not allowed!" next to them. Making
them public does not help.)

Finally, during the link stage I get:
xlate2.o: In function
`_22_IO_ostream_withassigniRC22_IO_ostream_withassign':
/usr/local/include/g++/iostream.h:232: undefined reference to `ios::ios(ios
const &)'
xlate2.o: In function `_7ostreamiRC7ostream':
/usr/local/include/g++/iostream.h:106: undefined reference to `ios::ios(ios
const &)'
Any comments, help or suggestions?

Apologies if these are stupid questions -- I am new to CygWin...

Thanks in advance for any help that may be provided...

-- 
Walter Prins                email: [email-masked]  | Sola Scriptura
MSc Student                         [email-masked]       | Sola Gratia
Department of Computer Science                               | Sola Fide
University of Stellenbosch    www: http://quark.cs.sun.ac.za | Soli Deo Gloria
South Africa   ---------------------------------------------------------------
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".