2021年10月随笔

1、查看路径内容

(1)PATH:可执行文件路径,各种/bin

$printenv PATH

(2)LIBRARY_PATH和LD_LIBRARY_PATH

LIBRARY_PATH is used by gcc before compliation to search directories containing static and shared libraries that need to be linked to your program.

LD_LIBRARY_PATH is used by your program to search directories containing shared libraries after it has been successfuly compiled and linked.

EDIT: As pointed below,  your libraries can be static or shared. If it is static then the code is copied over into your program and you don't need to search for the library after your program is compiled and linked. If your library is shared then it needs to be dynamically linked to your program and that's when LD_LIBRARY_PATH comes into play.

 2、shared and static libraries

Shared libraries are .so files. Static libraries are .a files.

A static library is like a bookstore, and a shared library is like... a library. With the former, you get your own copy of the book/function to take home; with the latter you and everyone else go to the library to use the same book/function. So anyone who wants to use the (shared) library needs to know where it is, because you have to "go get" the book/function. With a static library, the book/function is yours to own, and you keep it within your home/program, and once you have it you don't care where or when you got it.

上一篇:JS获取指定类名下的input/div/button等特定元素


下一篇:salesforce零基础学习(一百一十)list button实现的一些有趣事情