delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/22/01:56:05

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

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019