« Jon Stewart gives William & Mary's commencement addressThe housing bubble mid-burst? »

Setting library search paths in Unix

05/20/04 | by david2 [mail] | Categories: Geek
This information is common knowledge until you forget it and then it's a pain in the ass.

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

Permalink

3 comments

Comment from: dave [Visitor]
For Apache:

Libraries have been installed in:
/usr/local/apache2/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- use the `-RLIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
05/26/04 @ 01:43
Comment from: dave [Visitor]
setting compiler flags prior to configure:

export LDFLAGS='-L/var/qmail/vpopmail/lib -L/usr/local/BerkeleyDB.4.1/lib'

export CPPFLAGS='-I/usr/local/BerkeleyDB.4.1/include -I/usr/local/ssl/include'

05/27/04 @ 14:15
Comment from: dave [Visitor]
If you're using the correct version of solaris, you can eliminate ld_library_path this way:

to make /usr/local/lib a standard library path:

crle -c /var/ld/ld.config -l /usr/lib:/usr/lib/secure:/usr/local/lib [enter]
12/17/04 @ 15:37
July 2020
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Search

The requested Blog doesn't exist any more!

XML Feeds

multi-blog engine