Function rcpputils::find_library_path

Function Documentation

std::string rcpputils::find_library_path(const std::string &library_name)

Find a library located in the OS’s specified environment variable for library paths.

The environment variable and file format per platform:

  • Linux: ${LD_LIBRARY_PATH}, lib{}.so

  • Apple: ${DYLD_LIBRARY_PATH}, lib{}.dyld

  • Windows: PATH%, {}.dll

Parameters:

library_name[in] Name of the library to find.

Throws:

std::runtime_error – if an error is encountered when accessing environment variables.

Returns:

The absolute filesystem path, including the appropriate prefix and extension, or the empty string when the library was not found.