gpt4 book ai didi

c++ - LD_LIBRARY_PATH 和 LD_LIBRARY_PATH 有什么区别?

转载 作者:太空狗 更新时间:2023-10-29 20:23:30 28 4
gpt4 key购买 nike

在编译和链接CC++代码时,LTDL_LIBRARY_PATHLD_LIBRARY_PATH环境变量的作用是什么?另外它们还有什么区别?

谢谢

最佳答案

LTDL_LIBRARY_PATHlibtool library 设置库搜索路径,用于使用共享库的帮助程序/可移植性库。该库将在搜索 LD_LIBRARY_PATH 之前搜索此路径中的目录,这是一个为系统的共享库加载程序设置搜索路径的环境变量。

来自libtool documentation :

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):

  • user-defined search path: This search path can be changed by the program using the functions lt_dlsetsearchpath, lt_dladdsearchdir and lt_dlinsertsearchdir.
  • libltdl’s search path: This search path is the value of the environment variable LTDL_LIBRARY_PATH.
  • system library search path: The system dependent library search path (e.g. on GNU/Linux it is LD_LIBRARY_PATH)

如上所述,LD_LIBRARY_PATH is an environment variable that the system will use搜索共享库。

关于c++ - LD_LIBRARY_PATH 和 LD_LIBRARY_PATH 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33061198/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com