Development environment - linux set dynamic library specified path LD_LIBRARY_PATH

What is LD_LIBRARY_PATH?

LD_LIBRARY_PATH is the name of the environment variable under the Linux system, similar to Path (setting the search path of executable files).

Function: Used to specify paths other than the default paths (./lib and ./usr/lib) when searching for shared libraries (dynamic link libraries).

Use case : When porting programs, we often encounter the need to use some specific dynamic libraries, and these compiled dynamic libraries are placed in our own directories. At this time, these directories can be set to LD_LIBRARY_PATH.

 

View LD_LIBRARY_PATH:

echo $LD_LIBRARY_PATH

 

Set LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

 

The above setting method is only temporary. If you restart a window, you need to reset it.

Guess you like

Origin blog.csdn.net/Ivan804638781/article/details/97104741