This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
g++ global constructor bug?
- From: "Douglas S. J. De Couto" <decouto at lcs dot mit dot edu>
- To: cygwin at cygwin dot com
- Date: Fri, 5 Jul 2002 16:09:15 -0400 (EDT)
- Subject: g++ global constructor bug?
- Reply-to: decouto at lcs dot mit dot edu
the following program doesn't work right with cygwin, it seems the
global object sh constructor is not being called.
--------------------
#include <stdio.h>
struct foobar {
foobar(int i) { printf ("foobar(%d)\n", i); }
};
foobar sh(1);
int
main(int argc, char **argv) {
foobar s(2);
}
--------------------
bash-2.05a$ g++ foo.cc
bash-2.05a$ a.exe
foobar(2)
bash-2.05a$
i expected instead to see
foobar(1)
foobar(2)
i saw lots of stuff about DLLs etc., on the mailing list, but i am not
producing a DLL here.
$ g++ -dumpversion
2.95.3-5
--
Douglas S. J. De Couto decouto@lcs.mit.edu
--
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/