35#if defined(ARK_OS_WINDOWS)
36 if (NULL == (m_instance = LoadLibrary(
m_path.c_str())))
38 throw std::system_error(
39 std::error_code(::GetLastError(), std::system_category()),
"Couldn't load the library at " +
path);
41#elif defined(ARK_OS_LINUX)
42 if (NULL == (m_instance = dlopen(
m_path.c_str(), RTLD_LAZY | RTLD_GLOBAL)))
44 throw std::system_error(
45 std::error_code(errno, std::system_category()),
"Couldn't load the library at " +
path +
", " + std::string(dlerror()));
55#if defined(ARK_OS_WINDOWS)
56 FreeLibrary(m_instance);
57#elif defined(ARK_OS_LINUX)
Loads .dll/.so/.dynlib files.
~SharedLibrary()
Destroy the Shared Library object.
SharedLibrary()
Construct a new Shared Library object.
const std::string & path() const
void unload()
Unload the shared library.
void load(const std::string &path)
Load a shared library.