Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Wed, 22 Oct 2003 08:02:08 +0200
From: "Gerrit P. Haase" <gp@familiehaase.de>
Reply-To: "Gerrit @ cygwin" <cygwin@cygwin.com>
Organization: Esse keine toten Tiere
X-Priority: 3 (Normal)
Message-ID: <86315075494.20031022080208@familiehaase.de>
To: "jim" <jamesmc@localnet.com>
CC: cygwin@cygwin.com
Subject: Re: little help with dll
In-Reply-To: <000901c397eb$51de7cb0$93089942@BEDROOM>
References: <000901c397eb$51de7cb0$93089942@BEDROOM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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/

