一个在Centos5.5上编译samba时出现..
时间:2010-09-28 来源:lijichao
#./configure
#make
but, when linking smbclient, following error happen.
------------------------------------------------------------------
# make
Using CFLAGS = -O -I. -I/root/samba-3.5.0rc2/source3 -I/root/samba-3.5.0rc2/source3/iniparser/src -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/tevent -I./libaddns -I./librpc -I./.. -I./../lib/talloc -I../lib/tdb/include -DHAVE_CONFIG_H -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/tevent -I./libaddns -I./librpc -I./.. -I./../lib/popt -DLDAP_DEPRECATED -I/root/samba-3.5.0rc2/source3/lib -I.. -I../source4 -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
PICFLAG = -fPIC
LIBS = -lcap -lresolv -lresolv -lnsl -ldl -lpthread
LDFLAGS = -pie -Wl,-z,relro -Wl,--as-needed -L./bin
DYNEXP = -Wl,--export-dynamic
LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-z,relro -Wl,--as-needed -L./bin -lc -Wl,-z,defs
SHLIBEXT = so
SONAMEFLAG = -Wl,-soname=
Linking bin/smbclient
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `tgetnum'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `tgetent'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `tgetstr'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `tgoto'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `UP'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `BC'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `tputs'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `PC'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libreadline.so: undefined reference to `tgetflag'
collect2: ld returned 1 exit status
make: *** [bin/smbclient] Error 1
it says Set export LDFLAGS="-Wl,--no-as-needed" .
and before ./configure, set LDFLAGS ,then compile OK.