Library dependencies

Martin Ameskamp ma at informatik.uni-kiel.d400.de
Fri Dec 16 03:18:43 EST 1994


> GRASS'ers
> 
> I have what is really a Unix/C question, however it is relevant to this whole
> issue of 'why are people scared to compile GRASS'?
> 
> On our Solaris 5.3 system, one of the Motif libraries (libXm.so.2) fails to
> link unless the symbols 'regex' and 'regcmp' are defined in an additional
> library which, by trial-and-error, I discovered to be /usr/ccs/lib/libgen.a.
> Comp.lang.c is full of such titbits about inter-library dependencies, but
> where does all this expertise originally come from? ie, what I would like is
> some systematic method of interrogating the system in order to find out where
> various symbols are defined. One low-level way of doing it is to write a
> program which trawls through every lib file and invokes dlsym(), but I had
> something a bit more user-friendly in mind. Am I missing something here?

	What I do in such cases is the following (under ksh)
	% cd <some promising directory like /usr/lib>
	% for i in *.a; do
	> echo $i
	> nm $i|grep regex
	> done

	On our HP, the result in /lib is:
	Symbols from libPW.a[regex.o]:
	regex               |         0|extern|entry  |$CODE$
	Symbols from libc.a[regex.o]:
	_regexec            |      9176|extern|entry  |$CODE$
	regexec             |      9176|sdef  |entry  |$CODE$

	Martin



More information about the grass-dev mailing list