我使用的是 ubuntu 12.04。每次我启动我的 bash 终端并且每次我完成输入命令(然后按回车键)时,我都会收到以下消息:
ERROR: ld.so: object '/usr/lib/liblunar-calendar-preload.so' from LD_PRELOAD cannot be preloaded: ignored.
这很奇怪。 那么环境变量 LD_PRELOAD 是干什么用的呢?幕后发生了什么?
谢谢。
最佳答案
链接器会考虑一些环境变量。一个是 LD_PRELOAD
来自 man 8 ld-linux
:
LD_PRELOAD
A whitespace-separated list of additional, user-specified, ELF
shared libraries to be loaded before all others. This can be
used to selectively override functions in other shared
libraries. For setuid/setgid ELF binaries, only libraries in
the standard search directories that are also setgid will be
loaded.
因此,链接器将在加载其他库之前尝试加载 LD_PRELOAD
变量中列出的库。
如果在变量中列出了一个无法预加载的库,这可能是什么情况。查看设置了 LD_PRELOAD
的 .bashrc
或 .bash_profile
环境,然后从变量中删除该库。
关于linux - 错误 : ld. 所以:无法预加载对象 LD_PRELOAD:忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17723666/