Multiple choice technology programming languages

Error in loading shared libraries: lib xxx..so. x: cannot open shared object file: No such file or directory

  1. Resolve by update PATH variable

  2. Resolve by setting SHELLPATH variable

  3. Resolve by updating LD_LIBRARY_PATH

  4. Resolve by setting LIBRARY_PATH variable

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The error indicates the dynamic linker cannot find a required shared library at runtime. The LD_LIBRARY_PATH environment variable tells the dynamic linker where to search for shared libraries beyond the default paths. Options A, B, and D are incorrect: PATH is for executables, SHELLPATH doesn't exist for this purpose, and LIBRARY_PATH is used at compile time, not runtime.

AI explanation

This is a classic Linux dynamic linker error. The runtime linker (ld.so) searches the directories listed in LD_LIBRARY_PATH (plus ldconfig's cache and default paths) when resolving shared object (.so) dependencies at program startup. If the library lives in a non-standard directory, adding that directory to LD_LIBRARY_PATH lets the loader find it. PATH only affects lookup of executables, not shared libraries. SHELLPATH and LIBRARY_PATH are not the relevant runtime environment variables recognized by the dynamic linker (LIBRARY_PATH affects the linker/gcc at compile time, not runtime loading).