Subject: Re: Problems exporting my DLL functions...
From: "Gerrit P. Haase" <[email-masked]>
To: Lostmind <[email-masked]>
Cc: [email-masked]
Date: Wed, 21 Aug 2002 02:53:43 +0200

Hallo Lostmind,

Am Dienstag, 20. August 2002 um 22:41 schriebst du:

>> gcc -o khook.o -c khook.o
>> gcc -shared -o mydll.dll khook.o

> Cool, it works, thanx :D

> ...at least it creates a DLL, but finally two things:

> 1. How do I tell the compiler/linker what is my DLL-init-function

I don't tell it.

> 2. How do I tell the compiler/linker which functions I want to export (I
> marked them with EXPORT in the file already, but they didn't seem to be
> available in the created DLL)

The complete syntax is:

gcc -shared -o cyg${module}.dll \
    -Wl,--out-implib=lib${module}.dll.a \
    -Wl,--export-all-symbols \
    -Wl,--enable-auto-import \
    -Wl,--whole-archive ${old_lib} \
    -Wl,--no-whole-archive ${dependency_libs}

Where ${module} is the name of your DLL, ${old_lib} are all
objectfiles, bundled together in a static lib or single object
files and the ${dependency_libs} are importlibs you need to
link against, e.g '-lpng -lz -L/usr/local/special -lmyspeciallib'

All symbols are exported then because you tell the linker to do so:
-Wl,--export-all-symbols

Gerrit
-- 
"All faults& bugs are mine - Robert"
    from squid/acinclude.m4,   Sun Apr 21 05:21:21 2002

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/