33#if defined(ARK_OS_WINDOWS)
34 if (NULL == (m_instance = LoadLibrary(
m_path.c_str())))
36 throw std::system_error(
37 std::error_code(::GetLastError(), std::system_category()),
"Couldn't load the library at " +
path);
39#elif defined(ARK_OS_LINUX)
40 if (
nullptr == (m_instance = dlopen(
m_path.c_str(), RTLD_LAZY | RTLD_GLOBAL)))
42 throw std::system_error(
43 std::error_code(errno, std::system_category()), fmt::format(
"Couldn't load the library at {}, {}",
path, dlerror()));