libtool
[Top][All Lists]
Advanced

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

Re: libtool + MinGW


From: Brendon Costa
Subject: Re: libtool + MinGW
Date: Sat, 10 Jun 2006 10:44:28 +1000
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian Dessent wrote:
> I'm not sure why you are getting the link errors about duplicated
> symbols, but your testcase in general is not doing what you think it's
> doing.  You'll note that there is not a DLL created anywhere, and this
> is because you didn't use -no-undefined.

Thanks for this info. That has helped a little.

I have also found out a way of getting it to work, though i was
wondering if someone could explain why.

In my script i had a line like:

$LINK -all-static -o
$BUILDTOP/src/apps/libtool_test/static_libtool_test$SUFEXE
$BUILDTOP/src/apps/libtool_test/main.lo
$BUILDTOP/src/libs/Shared/libShared.la
$BUILDTOP/src/libs/Static/libStatic.la -dlopen
$BUILDTOP/src/plugins/LTDLOpened/LTDLOpened.la $LIBLTDL_LFLAGS
$LIBLTDL_LIBS


(Please excuse the multiple lines)

But when compiling with this i got the following errors:

c:/dev/BJC/System/build/BJC_temp/libltdl/.libs/libltdl.a(ltdl.o)(.data+0x0):
In function `rpl_argz_append':
c:/dev/BJC/System/libltdl/ltdl.c:578: multiple definition of `lt_dlfree'
c:/dev/BJC/System/build/BJC_temp/src/apps/libtool_test/.libs/main.o(.bss+0x8):C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/locale_facets.tcc:2494:
first defined here
c:/dev/BJC/System/build/BJC_temp/libltdl/.libs/libltdl.a(ltdl.o)(.data+0x4):
In function `rpl_argz_append':
c:/dev/BJC/System/libltdl/ltdl.c:578: multiple definition of `lt_dlrealloc'
c:/dev/BJC/System/build/BJC_temp/src/apps/libtool_test/.libs/main.o(.bss+0x4):C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/locale_facets.tcc:2493:
first defined here
c:/dev/BJC/System/build/BJC_temp/libltdl/.libs/libltdl.a(ltdl.o)(.data+0x8):
In function `rpl_argz_append':
c:/dev/BJC/System/libltdl/ltdl.c:578: multiple definition of `lt_dlmalloc'
c:/dev/BJC/System/build/BJC_temp/src/apps/libtool_test/.libs/main.o(.bss+0x0):C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/locale_facets.tcc:2493:
first defined here
collect2: ld returned 1 exit status



I had a look in the ltdl.h file and noticed that there are some global
function pointers for these variables. Now these were being compiled
into the file (Could see them when running nm on it):

c:/dev/BJC/System/build/BJC_temp/src/apps/libtool_test/.libs/main.o

and were also in the libltdl.a library which was being linked with the
main.o file. If i change the libtool invocation now to use main.o
instead of main.lo it works fine. I.e.

$LINK -all-static -o
$BUILDTOP/src/apps/libtool_test/static_libtool_test$SUFEXE
$BUILDTOP/src/apps/libtool_test/main.o
$BUILDTOP/src/libs/Shared/libShared.la
$BUILDTOP/src/libs/Static/libStatic.la -dlopen
$BUILDTOP/src/plugins/LTDLOpened/LTDLOpened.la $LIBLTDL_LFLAGS
$LIBLTDL_LIBS

It seems to me that the LT_EXPORT macro is defined differently for the
two different main objects. main.o and main.lo

Firstly should i be compiling my main.cpp file with libtool as i am or
should i just compile it normally? And secondly is this second usage of
libtool correct. I.e. should i always link with main.o? Under what
circumstances should i link with main.o or main.lo?

Thanks,
Brendon.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFEihXsLSWCuZeiyS0RAj5HAKCUmRVKVQLRx8ZqvHd3mMwIEDUkIgCgnq5j
fuK83hNWt7Dy1k07bwBoAlc=
=rBf5
-----END PGP SIGNATURE-----




reply via email to

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