[OpenAFS] Undefined symbol problem

David Botsch dwb7@ccmr.cornell.edu
Fri, 14 Nov 2003 17:14:49 -0500


Ok. So, now am trying to compile something with 
ka_UserAuthenticateGeneral... same as before: RH7.3, OAFS1.2.10

The test code, looks as follows:
#include <rx/xdr.h>
#include <afs/auth.h>
#include <afs/kautils.h>

void main(void) {
	int cellnum;
	char * reason;
	afs_int32 password_expires = -1;

	cellnum = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION +0, 
"user", "", "msc", "mypass", 0, &password_expires, 0, &reason);
}

So, attempting to compile as follows:

gcc -o test test.c -L/usr/lib/afs -lauth -lsys -lrxkad -lrx -llwp 
-lafsutil -lkauth -lrx -lpthread -llwp -lafsutil -lsys -lubik -lresolv 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a 
-ldes | & tee compile.out

Compile fails with multiply defined symbols changing sizes:

test.c: In function `main':
test.c:5: warning: return type of `main' is not `int'
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o): 
In function `rxi_ListenerProc':
rx_knet.o(.text+0x1b4): multiple definition of `rxi_ListenerProc'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_lwp.o)(.text+0x138): 
first defined here
/usr/bin/ld: Warning: size of symbol `rxi_ListenerProc' changed from 
856 to 212 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o): 
In function `rx_ServerProc':
rx_knet.o(.text+0x38c): multiple definition of `rx_ServerProc'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_lwp.o)(.text+0x4f8): 
first defined here
/usr/bin/ld: Warning: size of symbol `rx_ServerProc' changed from 145 
to 276 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o): 
In function `osi_NetSend':
rx_knet.o(.text+0x73c): multiple definition of `osi_NetSend'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_packet.o)(.text+0xca0): 
first defined here
/usr/bin/ld: Warning: size of symbol `osi_NetSend' changed from 76 to 
237 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o): 
In function `rx_Finalize':
rx_knet.o(.text+0x844): multiple definition of `rx_Finalize'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx.o)(.text+0x11a8): 
first defined here
/usr/bin/ld: Warning: size of symbol `rx_Finalize' changed from 116 to 
31 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o): 
In function `rxi_Recvmsg':
rx_knet.o(.text+0x864): multiple definition of `rxi_Recvmsg'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_lwp.o)(.text+0x624): 
first defined here
/usr/bin/ld: Warning: size of symbol `rxi_Recvmsg' changed from 12 to 
59 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_knet.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o): 
In function `rxi_GetUDPSocket':
rx_kcommon.o(.text+0xc8): multiple definition of `rxi_GetUDPSocket'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_user.o)(.text+0x0): 
first defined here
/usr/bin/ld: Warning: size of symbol `rxi_GetUDPSocket' changed from 
501 to 56 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o): 
In function `osi_Panic':
rx_kcommon.o(.text+0x100): multiple definition of `osi_Panic'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_user.o)(.text+0x1f8): 
first defined here
/usr/bin/ld: Warning: size of symbol `osi_Panic' changed from 100 to 71 
in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o): 
In function `rxi_StartListener':
rx_kcommon.o(.text+0x414): multiple definition of `rxi_StartListener'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_lwp.o)(.text+0xf4): 
first defined here
/usr/bin/ld: Warning: size of symbol `rxi_StartListener' changed from 
68 to 5 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o): 
In function `rxi_InitPeerParams':
rx_kcommon.o(.text+0x41c): multiple definition of `rxi_InitPeerParams'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../librx.a(rx_user.o)(.text+0x748): 
first defined here
/usr/bin/ld: Warning: size of symbol `rxi_InitPeerParams' changed from 
413 to 273 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(rx_kcommon.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(afs_osi_pag.o): 
In function `afs_get_pag_from_groups':
afs_osi_pag.o(.text+0x174): multiple definition of 
`afs_get_pag_from_groups'
/usr/lib/afs/libsys.a(rmtsysc.o)(.text+0x568): first defined here
/usr/bin/ld: Warning: size of symbol `afs_get_pag_from_groups' changed 
from 106 to 114 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(afs_osi_pag.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(afs_osi_pag.o): 
In function `afs_get_groups_from_pag':
afs_osi_pag.o(.text+0x1e8): multiple definition of 
`afs_get_groups_from_pag'
/usr/lib/afs/libsys.a(rmtsysc.o)(.text+0x5d4): first defined here
/usr/bin/ld: Warning: size of symbol `afs_get_groups_from_pag' changed 
from 104 to 117 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(afs_osi_pag.o)
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(afs_server.o): 
In function `afs_random':
afs_server.o(.text+0x112c): multiple definition of `afs_random'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libubik.a(ubikclient.o):/usr/src/redhat/BUILD/openafs-1.2.10/src/ubik/ubikclient.c:145: 
first defined here
/usr/bin/ld: Warning: size of symbol `afs_random' changed from 80 to 
109 in 
/afs/msc.cornell.edu/home/mscadm/dwb7/downloads/openafs-1.2.10/lib/libuafs.a(afs_server.o)
collect2: ld returned 1 exit status

Suggestions on what to do, here?

Thanks again!

On 2003.11.13 19:38 Derrick J Brashear wrote:
> On Thu, 13 Nov 2003, David Botsch wrote:
> 
> > Fascinating...
> >
> > that seems to have done the trick, since I now have to track down
> other
> > undefined things like:
> >
> > /usr/lib/afs/libauth.a(ktc.o): In function `ktc_GetToken':
> > /usr/src/redhat/BUILD/openafs-1.2.10/src/auth/ktc.c:546: undefined
> reference to
> > `pioctl'
> 
> -lauth -lsys -rxkad -lrx -llwp -lafsutil
> probably
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info
> 

-- 
********************************
David William Botsch
Consultant/Advisor II
CCMR Computing Facility
dwb7@ccmr.cornell.edu
********************************