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]

g++ global constructor bug?


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/


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