LFCS · Question #759
To what environment variable will an administrator assign or append a value if the administrator needs to tell the dynamic linker to look in a build directory for some of a program's shared libraries?
The correct answer is C. LD_LIBRARY_PATH. The LD_LIBRARY_PATH environment variable specifies additional directories where the dynamic linker should search for shared libraries during program execution.
Question
Options
- ALD_LOAD_PATH
- BLD_LIB_PATH
- CLD_LIBRARY_PATH
- DLD_SHARE_PATH
- ELD_RUN_PATH
How the community answered
(29 responses)- A3% (1)
- B3% (1)
- C90% (26)
- D3% (1)
Why each option
The `LD_LIBRARY_PATH` environment variable specifies additional directories where the dynamic linker should search for shared libraries during program execution.
`LD_LOAD_PATH` is not a standard environment variable used by the dynamic linker for specifying library search paths.
`LD_LIB_PATH` is not a standard environment variable used for this purpose by the dynamic linker, though it might be confused with the correct variable.
The `LD_LIBRARY_PATH` environment variable provides a colon-separated list of directories that the dynamic linker (e.g., `ld.so` on Linux) searches for shared libraries before looking in standard system locations. This is extremely useful for developers to test programs with custom-built libraries located in a build directory without installing them system-wide.
`LD_SHARE_PATH` is not a standard environment variable used by the dynamic linker for shared library search paths.
`LD_RUN_PATH` is a historical term or a conceptual path embedded in executables (often via RPATH during compilation) but not a runtime environment variable the dynamic linker uses in the same way as `LD_LIBRARY_PATH`.
Concept tested: Dynamic linker shared library path environment variable
Source: https://man7.org/linux/man-pages/man8/ld.so.8.html
Topics
Community Discussion
No community discussion yet for this question.