X-Spam-Check-By: sourceware.org Subject: Re: dlopen() bug From: skaller To: Bernhard Loos Cc: cygwin AT cygwin DOT com In-Reply-To: <454999904@web.de> References: <454999904 AT web DOT de> Content-Type: text/plain Date: Wed, 22 Mar 2006 06:30:48 +1100 Message-Id: <1142969448.9731.59.camel@rosella.wigram> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Tue, 2006-03-21 at 19:52 +0100, Bernhard Loos wrote: > Hello > > Is there any progress in solving the problem mentioned in this thread: > http://cygwin.com/ml/cygwin/2006-03/msg00274.html ? The example in that page is bugged and there is no reason at all to expect it to work. The mainline ct.c is a C program, it's compiled as a C program, and so cannot interact with C++ libraries. The mainline of any body of code using C++ MUST be compiled as C++. Furthermore you must NOT explicitly link libstdc++, that is the job of the compiler. The fact that the example works when libstdc++ is linked with the mainline simply suggests an implementation artefact that some startup code is stored in the library and the linker manages to execute it. There's no assurance this is actually initialising everything correctly. Some initialisation may need to be done 'on the bottom of the stack' and/or before other code, and it is too late when a dll is called half way through the program. -- John Skaller Felix, successor to C++: http://felix.sf.net -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/