15 std::unique_lock<std::mutex> lock(
_mutex);
19 throw std::runtime_error(
"Library already loaded: " + path);
22 _handle = dlopen(path.c_str(), RTLD_NOW | RTLD_GLOBAL);
25 const char* err = dlerror();
26 throw std::runtime_error(
"Could not load library: " + (err ? std::string(err) : path));
33 std::unique_lock<std::mutex> lock(
_mutex);
49 std::unique_lock<std::mutex> lock(
_mutex);
51 void* result =
nullptr;
54 result = dlsym(
_handle, name.c_str());
66 #if BT_OS == BT_OS_CYGWIN 75 #if BT_OS == BT_OS_MAC_OS_X 76 #if defined(_DEBUG) && !defined(CL_NO_SHARED_LIBRARY_DEBUG_SUFFIX) 81 #elif BT_OS == BT_OS_HPUX 82 #if defined(_DEBUG) && !defined(CL_NO_SHARED_LIBRARY_DEBUG_SUFFIX) 87 #elif BT_OS == BT_OS_CYGWIN 88 #if defined(_DEBUG) && !defined(CL_NO_SHARED_LIBRARY_DEBUG_SUFFIX) 94 #if defined(_DEBUG) && !defined(CL_NO_SHARED_LIBRARY_DEBUG_SUFFIX) static std::string prefix()
static std::string suffix()
const std::string & getPath() const
Simple class for manipulating paths on Linux/Windows/Mac OS.
void load(const std::string &path, int flags=0)
bool isLoaded() const
Unloads a shared library.
void * findSymbol(const std::string &name)