[comp.unix.amiga] Linking Problem With Xlib?

s000623@kowande.bu.oz.au (Jason Patterson) (03/08/91)

I know this might seem like a stupid question, but here goes...

Recently I have been trying to port some X software I wrote for a Decstation to my A3000UX. The problem is that even the simplest stuff (that only requires linking with Xlib) seems to produce many undefined references. These references are NOT from my code, but from the Xstreams.o module in libX11.a itself.

eg:  cc prog1.o prog2.o ... -lX11         produces...

undefined symbols             first referenced
getnetpath                  /usr/lib/libX11.a(Xstreams.o)
t_alloc                     /usr/lib/libX11.a(Xstreams.o)
t_open                      /usr/lib/libX11.a(Xstreams.o)
t_rcvdis                    /usr/lib/libX11.a(Xstreams.o)
t_netdir_free               /usr/lib/libX11.a(Xstreams.o)


The same code links perfectly on VaxStations and DecStations with X11R3, and uses nothing abnormal at all. In fact while trying to solve this problem, I discovered that even the example programs in /usr/X/lib/tutorial fail to link correctly!

Since the majority of the missing referebnces are prefixed by t_ I suspect that linking with another library is necessary, but I've tried quite a few with no luck.

If anyone knows what is going wrong here, I would love to hear about it...


THANKS IN ADVANCE

Jason Patterson


EMAIL: s000623@kowande.bu.oz.au
   OR  s000623@sand.sics.bu.oz.au

*******************************************
These are my views only, and are not
necessarily those of Bond University.
*******************************************

ag@amix.commodore.com (Keith "Cheese Whiz" Gabryelski) (03/08/91)

In article <1991Mar8.103924@kowande.bu.oz.au> s000623@kowande.bu.oz.au
(Jason Patterson) writes:
>eg:  cc prog1.o prog2.o ... -lX11         produces...
>
>undefined symbols             first referenced
>getnetpath                  /usr/lib/libX11.a(Xstreams.o)
>t_alloc                     /usr/lib/libX11.a(Xstreams.o)
>t_open                      /usr/lib/libX11.a(Xstreams.o)
>t_rcvdis                    /usr/lib/libX11.a(Xstreams.o)
>t_netdir_free               /usr/lib/libX11.a(Xstreams.o)

Try:
	cc prog1.o prog2.o ... -lX11 -lnsl -lsocket

The extra libs are networking magic.

Pax, Keith
-- 
Would you like some Bill Sperm with that?
Keith Gabryelski                                 Advanced Products Group
ag@amix.commodore.com                                 ...!cbmvax!amix!ag