To sum up, there are three primary methods: 1. Change the/etc/lD. So. conf configuration file, and then refresh
Vim/etc/lD. So. conf Add/where/you/install/lib Sudo ldconfig |
2. Use ln to link the required so file to the/usr/lib or/lib default directories.
Ln-S/where/you/install/lib/*. So/usr/lib
Sudo ldconfig |
3. Correct LD_LIBRARY_PATH
Export LD_LIBRARY_PATH =/where/you/install/lib: ¥ LD_LIBRARY_PATH Sudo ldconfig |
First, modify the system file:
In/etc/lD. so. the conf file specifies the default dynamic link library search path, my/etc/lD. so. the conf file contains include/etc/lD. so. conf. d /*. conf
That is to say, it indirectly specifies the file defining the path. We only need to add the required path to/etc/lD. so. conf. run ldconfig in any file in the d directory. However, to make it easy to understand, it is best to find a related file or create a new file, write the path to be added and run ldconfig
The second is to use the variable LD_LIBRARY_PATH:
Add the path to LD_LIBRARY_PATH. Note that if there are more than one path, separate it with a colon. For example, export LD_LIBRARY_PATH =/usr/local/lib/MiniGUI
The third is set during compilation:
When compiling the source code, you can use the parameter-WL and-rpath to specify the path for dynamic search.
I have used only two of the three methods, the first and the second.