Can't build a dynamically loadable library

Mumit Khan khan@xraylith.wisc.EDU
Tue Aug 31 23:49:00 GMT 1999

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. 


Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list