From: "Andreas Bierhals" Newsgroups: comp.os.msdos.djgpp Subject: Re: VERY STRANGE PROBLEM... Date: 19 Oct 1997 12:12:33 GMT Organization: RRZN - Newsserver Lines: 66 Message-ID: <01bcdc88$66652960$26b14b82@bierhals> References: <34481ACA DOT 7D513B88 AT nbnet DOT nb DOT ca> NNTP-Posting-Host: h38.stud.uni-hannover.de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi Jason! If I understood you well, you have (i) two classes, A and B, and (ii) two files, a.hpp and a.cpp. The declaration of class A is in a.hpp, while its definition is in a.cpp. However, the class B is declared AND defined in a.cpp in order to be hidden. Furthermore you defined a static instantiation of B in a.cpp with a fixed size-Argument for the constructor. I played around a little with this configuration and found out that sometimes, the order of invoking the constructors of A and B may be wrong (i.e. The constructor of A is invoked BEFORE the one of class B). I have attached to files, "test.h" and "test.cc" which illustrate this problem. To compile them, type: gcc -o test.exe test.cc Before compiling, there are two comment lines in test.cc (line 26 and line 48) which look like "// ##########", and directly after them "// A testClass(...)". One of the two instantiations of A must be activated before compiling. Invoking the two versions of test.exe (with the different positions of the line "A testClass(...)" should illustrate the pitfall, that I suppose to occur in your program. Sincerely, Andreas Bierhals begin 600 test.cc M(VEN8VQU9&4B=&5S="YH(@T*#0IC;&%SPT*("!P MPT* M("!I;G0@:2P@;#L-"B @PT*("!P