libtool
[Top][All Lists]
Advanced

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

Building a DLL with libltdl support


From: Bill Jones
Subject: Building a DLL with libltdl support
Date: Thu, 01 Jul 2004 19:05:51 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

I am trying to build a DLL which uses libltdl for dynamic loading of other libtool modules. As a result I am first building libltdl as a "convenience library" using

  ...
  AC_LIBLTDL_CONVENIENCE
  AC_SUBST(INCLTDL)
  AC_SUBST(LIBLTDL)
  AC_LIBTOOL_DLOPEN
  AC_PROG_LIBTOOL
  AC_CONFIG_SUBDIRS(libltdl)
  ...

in my configure.ac.  My DLL is then built with

  INCLUDES = @INCLTDL@
  lib_LTLIBRARIES = libname.la
  libname_la_SOURCES = ...
  libname_la_LDFLAGS = -no-undefined -avoid-version
  libname_la_LIBADD = @LIBLTDL@

All builds without error, however, on Windows under MinGW 3.1.0 and Msys 1.0.9 using

  automake 1.82.
  autoconf 2.59
  libtool 1.5.2

the resulting export library "libname.dll.a" does not contain any exported symbols other than those provided by libltdl (ex: lt_dlsym...lt_dladderror). The libtool link and resulting gcc commands presented by the `make` are paraphased below:

/bin/sh libtool --mode=link gcc -g -O2 -o libname.la -rpath ... -no-undefined -avoid-version file.lo libltdl/libltdlc.la gcc -shared .libs/file.o -Wl,--whole-archive libltdl/.libs/libltdlc.a -Wl,--no-whole-archive -o .libs/libname.dll -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libname.dll.a

Again, the library is created, there just aren't any exported symbols from file.o. However, if I instead manually link without the "--whole-archive" of the convenience library and simply use the ltdl object file

gcc -shared .libs/file.o libltdl/ltdl.o -o .libs/libname.dll -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libname.dll.a

The import library libname.dll.a contains the symbols for libltdl as well as those of file.o as expected.

Any help as to what I am doing wrong is greatly appreciated.

wtj
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    Bill Jones                                   address@hidden
    Mail Stop 125                       Data Analysis and Imaging Branch
    15 Langley Boulevard                  Systems Engineering Competency
    NASA Langley Research Center                Building 1268, Room 1038
    Hampton, VA  23681-2199                        Phone +1 757 864-5318
                                                     Fax +1 757 864-7635
                                             http://geolab.larc.nasa.gov





reply via email to

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