Newsgroups: comp.sys.next
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!howie
From: howie@cunixf.cc.columbia.edu (Howie Kaye)
Subject: Re: Xnext (mouse-X)
Message-ID: <1991Mar20.210206.29985@cunixf.cc.columbia.edu>
Reply-To: howie@cunixf.cc.columbia.edu (Howie Kaye)
Organization: Columbia University
References: <SCOTT.91Mar15175911@texnext.gac.edu> <1991Mar20.130027.17254@thunder.mcrcim.mcgill.edu> <1991Mar20.164422.10235@eplrx7.uucp>
Distribution: na
Date: Wed, 20 Mar 91 21:02:06 GMT


> I copied Mouse-X from Stanford.  Everything appears to work ok, except
> when I try to link a program with X11.  I get undefined symbols:
>
>  cc test.c -lXext -lX11 -lm
>  _XErrorFunction
>  _qfree
>  _XHeadOfDisplayList
>  _Xdebug
>  _XIOErrorFunction
>
>Any help with this problem is appreciated.  Thanks in advance.
>

This is because the global variables in the X libraries are
uninitialized.  So, the linker doesn't put them in the data segment,
but in another "Common" segment.  They don't get put into the symbol
table of the library.  Evidently, this is conformant with ANSI C.

To fix: 
1) initialize the variables
	or
2) ranlib -c -s all of the X libraries.  

------------------------------------------------------------
Howie Kaye				howie@columbia.edu
Columbia University 			hlkcu@cuvma.bitnet
UNIX Systems Group			...!rutgers!columbia!howie
