简体   繁体   English

LTDL_LIBRARY_PATH和LD_LIBRARY_PATH有什么区别?

[英]What is the difference betweend LTDL_LIBRARY_PATH and LD_LIBRARY_PATH?

In compiling and linking C and C++ code, what is the purpose of LTDL_LIBRARY_PATH and LD_LIBRARY_PATH environment variables? 在编译和链接CC++代码时, LTDL_LIBRARY_PATHLD_LIBRARY_PATH环境变量的目的是什么? In addition what is the difference between them? 另外它们之间有什么区别?

Thanks 谢谢

LTDL_LIBRARY_PATH sets a library search path for the libtool library , a helper/portability library for using shared libraries. LTDL_LIBRARY_PATHlibtool库设置库搜索路径, libtool库是一个使用共享库的帮助器/可移植性库。 That library will search the directories in this path before searching LD_LIBRARY_PATH which is an environment variable that sets a search path for the system's shared library loader. 该库将在搜索LD_LIBRARY_PATH之前搜索此路径中的目录, LD_LIBRARY_PATH是一个环境变量,用于设置系统共享库加载器的搜索路径。

From the libtool documentation : libtool文档

If libltdl cannot find the library and the file name filename does not have a directory component it will additionally look in the following search paths for the module (in the following order): 如果libltdl找不到库并且文件名filename没有目录组件,它还会在模块的以下搜索路径中查找(按以下顺序):

  • user-defined search path: This search path can be changed by the program using the functions lt_dlsetsearchpath , lt_dladdsearchdir and lt_dlinsertsearchdir . 用户定义的搜索路径:程序可以使用函数lt_dlsetsearchpathlt_dladdsearchdirlt_dlinsertsearchdir更改此搜索路径。
  • libltdl 's search path: This search path is the value of the environment variable LTDL_LIBRARY_PATH . libltdl的搜索路径:此搜索路径是环境变量LTDL_LIBRARY_PATH的值。
  • system library search path: The system dependent library search path (eg on GNU/Linux it is LD_LIBRARY_PATH ) 系统库搜索路径:系统相关的库搜索路径(例如在GNU / Linux上它是LD_LIBRARY_PATH

As mentioned above, LD_LIBRARY_PATH is an environment variable that the system will use to search for shared libraries. 如上所述, LD_LIBRARY_PATH是系统将用于搜索共享库的环境变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM