libtool
[Top][All Lists]
Advanced

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

linking static/shared libs with with undefined symbols on linux


From: laszlo . szakony
Subject: linking static/shared libs with with undefined symbols on linux
Date: Fri, 4 Feb 2005 16:14:27 +0100


Let  a static lib libst0.la contain two modules: func_st01 and func_st02.
func_st02 contains and undefined symbols: 'st02_undef_sym'.
I link 'libst0.la' into a shared lib 'libdyn1.la' where the module func_st02 is not referenced at all.
I link 'libdyn1.la' into an executable 'exedyn1'  where the module func_st02 is not referenced at all.
I get the following error message:
        undefined reference to `st02_undef_sym'

Here are the makefiles.am-s:

**** makefile.am for libst0.la
libdir = ${ABS_ROOT_DIR}/libs
lib_LTLIBRARIES = libst0.la
libst0_la_SOURCES = func_st01.cpp func_st02.cpp
libst0_la_LDFLAGS = -all-static

**** makefile.am for libdyn1.la
libdir = ${ABS_ROOT_DIR}/libs
lib_LTLIBRARIES = libdyn1.la
libdyn1_la_SOURCES = func_dyn1.cpp
libdyn1_la_LIBADD = -lst0
libdyn1_la_LDFLAGS = -L${ABS_ROOT_DIR}/libs

**** makefile.am for exedyn
bindir = ${ABS_ROOT_DIR}/libs
bin_PROGRAMS = exedyn1
exedyn1_LDADD = ${ABS_ROOT_DIR}/libs/libdyn1.la
exedyn1_SOURCES = func_exe1.cpp


However, if I link the static library 'libdyn1.a' into 'exedyn1', then it works.

Question: Does a linker flag exists to ignore unused undefined references for Linux?
If yes, how can I set it only for Linux in the  mafile.am? (on OSX works with shared libs).


Thanks in advance!

___________________________________________________
László   Szakony
Philips Austria GmbH
Philips Speech Recognition Systems
Triester Str. 64, A-1101 Vienna  
Tel.+43 1 601 01 2102         Fax +43 1 601 01 4145
E-mail: address@hidden
___________________________________________________

reply via email to

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