From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: global constructor using iostreams fail 31 Aug 1998 22:49:32 -0700 Message-ID: <9809010519.AA04800.cygnus.cygwin32.developers@modi.xraylith.wisc.edu> To: cygwin32-developers AT cygnus DOT com Does anybody have an idea why the streambuf vtable is not being initialized correctly in cygwin32 apps? Basically, the following fails: #include struct Foo { Foo () { cout << " creating foo." << endl; ~Foo () { cout << " deleting foo." << endl; }; Foo foo; int main () { return 0; } Looks like the io jump tables aren't being initialized before main, and the code in cout ends up trying to dereference a null pointer (to a function _IO_xsputn or some such). I don't understand cygwin startup enough to understand what's going on. The complexity of libio doesn't help matters much either. This works just fine under other x86-win32 targets. Regards, Mumit