Jean-Francois Dockes
2006-Jan-13 06:48 UTC
[Xapian-devel] xapian-config --libs outputs libstdc++.la as a dependency
Hello,
I am hearing of users having trouble linking with libxapian (on slackware
and gentoo systems, and 0.9.2 I think), and I am not too sure where the
problem comes from, or what the correct solution could be, so I am just
asking here in case someone has a quick answer.
What happens is that "xapian-config --libs" outputs libstdc++.la in
the
list of libraries. Something like:
-L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib \
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/libstdc++.la
As recoll is linked with g++, this generates an error (I guess it might
work if libtool was used?).
The libstdc++ data seems to come from libxapian.la ('dependency_libs'
variable).
I don't see this happening on any on my systems (FreeBSD, Solaris, Redhat
7.3, Fedora core 4), so I guess I'll have to install gentoo somewhere to
look into this, except if someone here can tell me what goes wrong and what
I could do about it.
I am pasting a libxapian.la (from a gentoo system) at the end of this message.
Regards,
J.F. Dockes
# libxapian.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.18 (1.1220.2.245 2005/05/16 08:55:27)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libxapian.so.8'
# Names of this library.
library_names='libxapian.so.8.0.0 libxapian.so.8 libxapian.so'
# The name of the static archive.
old_library='libxapian.a'
# Libraries that this one depends upon.
dependency_libs=' -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/libstdc++.la'
# Version information for libxapian.
current=8
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/lib'
Olly Betts
2006-Jan-13 21:47 UTC
[Xapian-devel] xapian-config --libs outputs libstdc++.la as a dependency
On Fri, Jan 13, 2006 at 07:48:10AM +0100, Jean-Francois Dockes wrote:> What happens is that "xapian-config --libs" outputs libstdc++.la in the > list of libraries. Something like: > > -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib \ > /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/libstdc++.laHmm, that's not good. I guess we need to recursively check for .la files in dependency_libs and substitute the actual library to link against, plus the contents of the .la file's dependency_libs. That's a bit fiddly though... We might be able to get away with just dropping libstdc++.la, since linking C++ code should pull it in anyway. I can't see any other .la files making it in there unless we start depending on other libraries. Anyway, I'll take a look.> As recoll is linked with g++, this generates an error (I guess it might > work if libtool was used?).If you're using libtool, then xapian-config --ltlibs should be used instead (which happens automatically if you use XO_LIB_XAPIAN in configure.in/configure.ac and use AC_PROG_LIBTOOL or AM_PROG_LIBTOOL). Cheers, Olly
Apparently Analagous Threads
- undefined reference when linking against libresolv
- make dllimport/dllexport attributes work with mingw (and others)
- Re: remove non-portable chmod from libtool-kill-dependency_libs.sh (#10)
- LIttle problem when installing xapian-bindings-1.4.22
- build error : xapian-core-0.9.4_svn6707