X-Spam-Check-By: sourceware.org Subject: help with dynamic linkage? From: skaller To: cygwin AT cygwin DOT com Content-Type: text/plain Date: Sat, 11 Feb 2006 16:11:50 +1100 Message-Id: <1139634710.8498.16.camel@rosella> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 hi, I'm having some problem getting dynamic linkage to work. The linkage model is like this: mainline <----- load time ---- librtl.dll ^ / \ / dlopen / \ / user.dll <----------------- gdb indicates the code is crashing in dlopen. LoadLibrary doesn't appear to work either :) All the code is C++. It works on Linux, it works with the option -mnocygwin, and it works with MSVC++. It *used* to work with Cygwin. The problem is almost certainly just using the wrong linker switches. The linkage technique is to follow Linux: no export libraries are built, build time linkage is done directly against the dll. This works fine for a simple C program. In order to build according to the above model, there are 3 compilation steps, and 3 linkage steps. However, the crash is unrelated to building the user.dll, since it occurs whenever mainline calls dlopen, even with a garbage name. I have cygwin installed on 2 comps and get the same result. I have tried two methods: generate and link against export file librtl.dll.a, and just linkagainst librtl.dll. Both methods fail. Warnings like: Info: resolving vtable for XXXby linking to __imp__XXX (auto-import) occur when linking the executable. Switches: -O3 -fomit-frame-pointer --inline Hosts: * AMD64 running XP pro SP1 * AMD64x2 running XP64 Cygwin: latest setup provides. Any hints what is causing the problem or how to fix it? -- 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/