delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/20/17:29:39

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
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 <khan AT xraylith DOT wisc DOT EDU>

James Stern <jsternitg AT yahoo DOT com> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019