diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2016-08-17 15:20:07 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2016-08-17 15:20:07 (GMT) |
commit | 82df3b3071bb003247c33eac4670775e9883c994 (patch) | |
tree | c4fc7dd8a1c307d4592655a16c174f93a18be3a4 /Doc | |
parent | 48e4bd6a0278a022a38dc07777834a174adfef55 (diff) | |
download | cpython-82df3b3071bb003247c33eac4670775e9883c994.zip cpython-82df3b3071bb003247c33eac4670775e9883c994.tar.gz cpython-82df3b3071bb003247c33eac4670775e9883c994.tar.bz2 |
Closes #9998: Allowed find_library to search additional locations for libraries.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/ctypes.rst | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index a675790..2870940 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1239,9 +1239,10 @@ When programming in a compiled language, shared libraries are accessed when compiling/linking a program, and when the program is run. The purpose of the :func:`find_library` function is to locate a library in a way -similar to what the compiler does (on platforms with several versions of a -shared library the most recent should be loaded), while the ctypes library -loaders act like when a program is run, and call the runtime loader directly. +similar to what the compiler or runtime loader does (on platforms with several +versions of a shared library the most recent should be loaded), while the ctypes +library loaders act like when a program is run, and call the runtime loader +directly. The :mod:`ctypes.util` module provides a function which can help to determine the library to load. @@ -1259,8 +1260,14 @@ the library to load. The exact functionality is system dependent. On Linux, :func:`find_library` tries to run external programs -(``/sbin/ldconfig``, ``gcc``, and ``objdump``) to find the library file. It -returns the filename of the library file. Here are some examples:: +(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. +It returns the filename of the library file. + +.. versionchanged:: 3.6 + On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used + when searching for libraries, if a library cannot be found by any other means. + +Here are some examples:: >>> from ctypes.util import find_library >>> find_library("m") |