Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199908202124.QAA07369@mercury.xraylith.wisc.edu> To: stern AT itginc DOT com cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Can't build a dynamically loadable library In-Reply-To: Your message of "Fri, 20 Aug 1999 13:14:06 PDT." <19990820201406 DOT 5755 DOT rocketmail AT web1403 DOT mail DOT yahoo DOT com> Date: Fri, 20 Aug 1999 16:24:59 -0500 From: Mumit Khan James Stern writes: > This is one of the alternatives I tried (#4 in my > original note). However, I couldn't get dllhelpers > to resolve references from my DLL back to the main. > > I'm sure that whatever I'm doing wrong is obvious but > I can't see it. That's because Windows32 executable model, which includes DLLs and what we usually call executables, is not the same as Unix! On Windows32, executables and DLLs need to explicitly export symbols. Also, DLLs need to be "self-contained", ie., no unresolved symbols at link time, which means to be able to link in a symbol from the "main executable", you'll need to address the link order issue. GNU linker doesn't support --export-dynamic yet, but you can use a DEF file and export symbols explicitly. One way to achieve what you're trying to do is the following: export the symbols from executable, and use LoadLibrary from the DLL to load it dynamically from the exec. I've never tried this, but at least in theory it should work fine. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com