This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: little help with dll
- From: "Gerrit P. Haase" <gp at familiehaase dot de>
- To: "jim" <jamesmc at localnet dot com>
- Cc: cygwin at cygwin dot com
- Date: Wed, 22 Oct 2003 08:02:08 +0200
- Subject: Re: little help with dll
- Organization: Esse keine toten Tiere
- References: <000901c397eb$51de7cb0$93089942@BEDROOM>
- Reply-to: "Gerrit @ cygwin" <cygwin at cygwin dot com>
Hallo jim,
Am Dienstag, 21. Oktober 2003 um 17:52 schriebst du:
> Hi -
> i'm a newbie trying to create a dll for cygwin with gcc mingw for swig so i
> can convert c++ into a tcl module. $LIBS and $LIBPATH are 2 settings that i
> dont where/what to specify.
You want a DLL, so tell the linker the name of the DLL:
'-o my_lib.dll'
you want the linker to find the symbols for the functions you're
using, so tell the linker in which path and in which library to find
it:
'-L/usr/local/lib -lz -lintl -liconv'
> is this quote true also?
> "Note that if you build your DLL as a Cygwin-linked DLL, you should really
> load it from a Cygwin-linked Tcl/Tk shell as well to avoid certain
> problems. If you're using Cygwin b20.x, it already comes with tclsh/wish
> etc, and it's a non-issue then."
I don't know if this is still true.
> below is documentation from swig tutorial to help clarify
> any input/examples and links you can provide to help me come up with a
> solution would be great.
[...]
The docs are ok.
You may want to try this linkline (from the Cygwin docs):
gcc -shared -o cyg${NAME}.dll -Wl,--out-implib=lib${NAME}.dll.a \
-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive
${OBJECTS} -Wl,--no-whole-archive ${LIBSPATH} ${LIBS}
You'll get an importlibrary which is stored in the $LIBPATH and a DLL
which is used at runtime and needs to be somewhere in the $PATH.
HTH,
Gerrit
--
=^..^=
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/