Subject: libraries problem
To: netbsd-users@NetBSD.org <netbsd-users@netbsd.org>
From: Rakhesh Sasidharan <rakhesh@cse.iitd.ernet.in>
List: netbsd-users
Date: 03/14/2001 22:45:10
Hi,

If I have libraries installed in /usr/pkg/lib, how do I ensure that
programs find them while compiling ?

I know that LD_LIBRARY_PATH should do the trick, but it doesn't quite work
for me.  For example, I do:

[root@NetBSD](cucipop-1.31)# export LD_LIBRARY_PATH=/usr/pkg/lib/
[root@NetBSD](cucipop-1.31)# ls -al /usr/pkg/lib/libdb2*
-rw-r--r--  1 root  wheel  372542 Dec 24 05:51 /usr/pkg/lib/libdb2.a
-r--r--r--  1 root  wheel     642 Dec 24 05:51 /usr/pkg/lib/libdb2.la
lrwxr-xr-x  1 root  wheel      13 Dec 24 05:51 /usr/pkg/lib/libdb2.so -> libdb2.so.2.7
lrwxr-xr-x  1 root  wheel      13 Dec 24 05:51 /usr/pkg/lib/libdb2.so.2 -> libdb2.so.2.7
-r--r--r--  1 root  wheel  285728 Dec 24 05:51 /usr/pkg/lib/libdb2.so.2.7

And then:

[root@NetBSD](cucipop-1.31)# gmake install
cc -O -DUSE_DB  cucipop.o authenticate.o atotime.o locking.o xcreat.o dbops.o hsort.o simplecrypt.o md5/md5c.o -o cucipop -lcrypt -ldb2 
/usr/bin/ld: cannot open -ldb2: No such file or directory
collect2: ld returned 1 exit status
gmake: *** [cucipop] Error 1

The error went of when I linked the above libd2 libraries to /usr/lib (OR
used the -L/usr/pkg/lib to cc), but what is The Right Way (TM) to do it
:) ?

Similarly, if I have include files lying in /usr/pkg/include, how do I get
programs to use that ?


Regards.
__
Rakhesh Sasidharan	rakhesh at cse.iitd.ac.in