-1

i have seen many links for LD_LIBRARY_PATH but dont able to get a exact way for LD_LIBRARY_PATH. i used ldd (for dynamic libraries) there i need

linux-gate.so.1 =>  (0x00f84000)
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x0018c000)
libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x00318000)
libxmlsec1.so.1 => /usr/local/lib/libxmlsec1.so.1 (0x00caa000)
libprotobuf-c.so.0 => /usr/local/lib/libprotobuf-c.so.0 (0x00957000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x00110000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x009cc000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00136000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0x00b89000)
libxslt.so.1 => /usr/local/lib/libxslt.so.1 (0x0013a000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0x00172000)
libltdl.so.7 => /usr/lib/libltdl.so.7 (0x0017b000)
/lib/ld-linux.so.2 (0x007d1000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x00d6a000)

please tell the exact way and where i have to defined with path.

Stefano Sanfilippo
  • 32,265
  • 7
  • 79
  • 80
user2309820
  • 13
  • 1
  • 2
  • 4
  • Possible duplicate of [How to set the environmental variable LD\_LIBRARY\_PATH in linux](https://stackoverflow.com/q/13428910/608639), [Why changing LD_LIBRARY_PATH has no effect in Ubuntu?](https://stackoverflow.com/q/47682750/608639), [Where is LD_LIBRARY_PATH? how do I set the LD_LIBRARY_PATH env variable?](https://unix.stackexchange.com/q/168340), etc. – jww Nov 03 '19 at 12:46

1 Answers1

5

The simplest way to do it is on the same command line of your program:

LD_LIBRARY_PATH="/my/special/path:$LD_LIBRARY_PATH" myprogram

You can also export that variable to make it persist through commands in the current terminal:

export LD_LIBRARY_PATH="/my/special/path:$LD_LIBRARY_PATH"

myprogram1
myprogram2

In this case, both programs will see the new library path.

Stefano Sanfilippo
  • 32,265
  • 7
  • 79
  • 80