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]

Re: Shared library question

Josep Lluis Colom wrote:
> I used autoconf/automake/libtool to write a package that builds two
> shared libraries in Linux, and it worked as expected.
> Now I'm trying to do the port to Windows.
> After installing Cygwin software. I can't build the shared libraries.
> After compiling the source modules, libtool complains with: "Warning:
> undefined symbols not allowed in i686-pc-cygwin shared libraries". Only
> '.a', '.la' and '.lai' files are built.

Correct. Current (and CVS) versions of libtool do not easily build
shared libs (DLLs) on cygwin.  This will probably be corrected in the
coming months, thanks to yesterday's new (experimental) binutils

There is a hacked up version of libtool that uses pre-release versions
of automake, binutils[as of yesterday, no longer pre-release], and
friends to 'cleanly' build shared libs -- but it is a long way from even
making it into libtool CVS, much less an 'official' libtool release.

> Someone knows what its the pitfall?

"doctor, it hurts when it do this"  "Don't do that".

You basically have three choices:
 a) live with static libs only
 b) wait a few months until the tools 'catch up'. (perhaps help
develop/test those tools?)
 c) hack up your source code to explicitly build DLLs.  This requires a
lot of 'heavy lifting'.  Take a look at the patch to the ncurses
package, for an idea of what this entails.  (Download the source package
from a cygwin mirror, and look in <ncurses-src>/CYGWIN-PATCHES/)

> (I'm using the same source files I used in Linux platform. Is that ok?
> Shall I define some kind of dllexport like in plain Windows DLLs?


> There's some clear sample hot to do it?)

Well, other than the ncurses example, you can download dllhelpers-0.2.6
(NOT 0.2.7) from cygutils.  (See recent ANN on this mailing list for


Unsubscribe info:
Bug reporting:

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