This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems exporting my DLL functions...

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

> 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:

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

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]