[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DLLs on mingw

From: Steve Edwards
Subject: DLLs on mingw
Date: Thu, 4 Dec 2008 12:26:46 +0000


I just ran into a small problem using libtool to build DLLs on mingw.

A library package had just been updated to libtool 2.2.6 and DLLs were
no longer being built - only the static library.

libtool reported that:

"undefined symbols not allowed in $host shared libraries"

however I knew the DLL had built previously and could find no undefined
symbols in the library.

I eventually tracked it in the libtool script to the following section
(sorry if the text wrapping gets broken on this):

func_mode_link ()
    case $host in
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
      # It is impossible to link a dll without this setting, and
      # we shouldn't force the makefile maintainer to figure out
      # which system we are compiling for in order to pass an extra
      # flag for every libtool invocation.
      # allow_undefined=no

      # FIXME: Unfortunately, there are problems with the above when
trying # to make a dll which has undefined symbols, in which case not
      # even a static library is built.  For now, we need to specify
      # -no-undefined on the libtool link line when we can be certain
      # that all symbols are satisfied, otherwise we get a static

It appears from the FIXME that on mingw libtool is enforcing static
library builds only, regardless of whether there are undefined symbols
or not. Is this correct?

I fixed the problem by adding an explicit "-no-undefined" to the
libtool link command - is this considered to be the correct fix or am I
missing something obvious?

I would have expected that if I tried to build a dll with undefined
symbols that the build would fail, rather than libtool only building
static libraries regardless.

I'd be grateful for any further information on this

Yow! of the hour:
The probability of someone watching you is proportional to
the stupidity of your action.__7

reply via email to

[Prev in Thread] Current Thread [Next in Thread]