UID:64149
UID:7394
Locating Libraries at RuntimeOnce a program has been linked to use shared libraries, it must be able to find the shared library when it runs. The libraries are located by name, not by directory, so it is possible to link the program against one copy of the library and run it using another. This can, of course, cause problems if yous witch from one version of the library to another without updating the program—which is the reason most libraries include a version number as part of the name (for example, libm.so.6 or libutil-2.2.4.so).Whenever a program loads and prepares to run, the shared libraries it needs are sought in the following places:■ Each of the directories listed in the colon-separated list in the environment variable LD_LIBRARY_PATH■ The list of libraries found in the file /etc/ld.so.cache, which is maintained by the ldconfig utility■ The directory /lib■ The directory /usr/libIf you want to find out which libraries are being loaded and used by a specific application, you can use the ldd utility described later in this chapter.Another environment variable, LD_PRELOAD, can contain a list of shared librarynames (separated by spaces, tabs, or newlines) that will be preloaded before any other library searching takes place. In this way, you can override the functions that would normally be loaded from a shared library. For security reasons, some limitations are imposed on this technique for setuid programs.
引用第2楼leehus于2009-12-31 10:37发表的 :多谢楼上的,可是我已经在pro文件指定了lib的位置了,而且库文件的名字也是对的,他找libgood.so.1,我的lib文件夹下有这个文件啊,为什么还是没找到呢???
UID:65390
UID:9811
UID:90142
UID:88244