Click to See Complete Forum and Search --> : Adding library directories to ld?


martoony
02-21-2001, 05:02 PM
Hi! I'm writing programs under Linux Mandrake 7.2 and am tired of typing in the directories of my personal libraries (namely pgplot) when compiling. For example, in the following command:

g77 -o progname progsource.f -L/librarydirectory -llibrary

I would like to skip the -L part. So, how do I get /usr/bin/ld to automatically search librarydirectory? I tried modifying the /etc/ls.so.conf file, but it still doesn't work. Can anyone give me a step by step guide to doing this? Thanks a lot!

Strike
02-21-2001, 05:11 PM
Did you run ldconfig after modifying that file?

Also, try appending that directory onto the environment variable LD_LIBRARY_PATH

martoony
02-21-2001, 07:19 PM
Hey Strike. Yeah, I ran ldconfig after I modified it with no luck. I'm not sure how to go about editing the LD_LIBRARY_PATH variable though, so I haven't tried it yet. Could you give me some help on doing this? Thanks!

martoony
02-21-2001, 08:11 PM
Scratch that. I tried modifying that variable, but it still did not work. What the heck is going on!? Any help would be appreciated.

r00t619
02-21-2001, 08:44 PM
inside /etc/ld.so.conf you can place the absolute path there "/usr/local/lib" for example. After you save it then run ldconfig -v and see if it did parse through that directory you entered.