How to build a DLL

Charles Wilson cwilson@ece.gatech.edu
Mon Jul 17 08:08:00 GMT 2000


Fabio Tamburini wrote:
> 
> Hi
> I am a novice of cygwin and I am wondering if it is possible to compile
> a lib???.a archive into
> a DLL library using the cygwin environment.
> How can I do that? Is there a tutorial on it?
> 
> Thanks...
> 
> Please answer directly using my email.
> 

Please search the mail archives; this question has been asked many times
in the past. Also, see Mumit Khan's web page (there's a link to it on
the Cygwin web page/'related links').

Short version:

mkdir foo
cd foo
cp lib????.a .
ar x lib????.a
gcc -shared -Wl,--enable-auto-image-base *.o -o lib????.dll
-Wl,--out-implib=lib????.dll.a 

This creates a dll and an import lib. BTW, gcc *actually* delegates this
job to the linker ld.exe, and the in official version
(binutils-20000625) these features are broken. You can get a patched
version of ld.exe at
http://cygutils.netpedia.net/V1.1/linker/ld.exe.tar.gz

--Chuck

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list