1 #ifndef LSST_BASE_LIBRARY_H
2 #define LSST_BASE_LIBRARY_H
8 #ifndef RTLD_DEEPBIND // Non-POSIX flag, so it may not exist
9 #define RTLD_DEEPBIND 0 // Will be ignored
19 std::runtime_error(
"Unable to dynamically load library " + name) {};
21 std::runtime_error(
"Unable to find function " + func +
" from dynamically loaded library " + lib) {};
40 std::string
const& libName
52 std::string
const& libName,
53 std::string
const& symName
62 (
void*&)sym = dlsym(lib, symName.c_str());
T * loadSymbol(std::string const &libName, std::string const &symName)
Load a symbol from a dynamic library.
std::string getLibraryFilename(std::string const &name)
Get filename for library.
std::string libraryExtension()
Return filename extension for libraries.
LibraryException(std::string const &name)
LibraryException(std::string const &lib, std::string const &func)
bool canLoadLibrary(std::string const &libName)
Return whether we can load a library.