[Top][All Lists]

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

linking: libraries included multiple times

From: Adrian Sheppard
Subject: linking: libraries included multiple times
Date: Fri, 30 Nov 2001 11:46:13 +1100


I'm using libtool in my project for the first time, and I can't seem to
get it working.  Autoconf/make have been running fine for ages.
I'm including the whole example since I don't know what's relevant and
what isn't.  

I'm using the libtool from RH7.2, which is libtool-1.4-8

automake generates this call:

/bin/sh ../libtool /usr/local/bin/g++ -ggdb3 -Wall -Winline -o -rpath ../lib main.lo global.lo main_util.lo
segmentation/ visualisation/ burn/
mpi/ io/ -lpthread -lGL -lXt
-lX11 -lmpi -llam -lm -L/usr/local/lib -L/usr/X11R6/lib 

note that there is only a single reference to -lmpi and -llam

libtool then makes these calls:

rm -fr .libs/ .libs/libmed_ax.* .libs/libmed_ax.*

/usr/local/bin/gcc -shared  main.lo global.lo main_util.lo -Wl,--whole-archive 
segmentation/.libs/ visualisation/.libs/ 
burn/.libs/ mpi/.libs/ io/.libs/ 
/usr/lib/libmpi.a /usr/lib/liblam.a -Wl,--no-whole-archive  -L/usr/X11R6/lib 
segmentation/.libs/ visualisation/.libs/ 
burn/.libs/ mpi/.libs/ io/.libs/ 
-lMiscUtils-MPI -lVTKContrib -lVTKPatented -lVTKImaging -lVTKGraphics 
-lVTKCommon -lpthread /usr/lib/ -lXt -lX11 /usr/lib/libmpi.a 
/usr/lib/liblam.a -lm -L/usr/local/lib -L/users/appmaths1/aps110/lib       
-Wl,-soname -Wl, -o .libs/

"-lmpi -llam" has morphed into "/usr/lib/libmpi.a /usr/lib/liblam.a"
which appears twice and therefore leads to undefined symbols.  Now I
notice that libmpi and liblam are the only .la "libtool" libraries that
I'm linking against.  So it looks to me as though libtool can't handle
it's own prodigy?

I've been bashing my head against this for a while now, any advice would 
be much appreciated.

adrian sheppard

PS for info, my looks like

# src/ for med_ax
SUBDIRS = mpi io burn segmentation python visualisation # fiducial testsuite
INCLUDES = address@hidden@/include
MAIN_SOURCES = main.C global.C main_util.C

libmed_ax_la_LIBADD = segmentation/ visualisation/ \
                libburn/ mpi/ io/  
libmed_ax_la_SOURCES = $(MAIN_SOURCES)


                                       _-~   Adrian Sheppard     ~-_
   ,__o ,__o           ,__o         _-~     Dept. Applied Maths     ~-_
 _-\ <,-\ <,         _-\ <,      _-~   Australian National University   ~-_
(*)/(*))/(*)        (*)/(*)   _-~  e-mail:  address@hidden 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   Ph: +61.2.6125.2846   Fax:+61.2.6125.0732

reply via email to

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