diff --git a/include/boost/dll/import.hpp b/include/boost/dll/import.hpp index 9c7ce06f..e6110a10 100644 --- a/include/boost/dll/import.hpp +++ b/include/boost/dll/import.hpp @@ -13,6 +13,7 @@ #include // std::addressof #include +#include #ifdef BOOST_HAS_PRAGMA_ONCE # pragma once @@ -105,13 +106,17 @@ namespace detail { * Overload that accepts path also throws std::bad_alloc in case of insufficient memory. */ template -BOOST_DLL_IMPORT_RESULT_TYPE import_symbol(const boost::dll::fs::path& lib, const char* name, +BOOST_DLL_IMPORT_RESULT_TYPE import_symbol(const boost::dll::fs::path& path, const char* name, load_mode::type mode = load_mode::default_mode) { using type = boost::dll::detail::import_type; - - auto p = boost::dll::detail::make_shared(lib, mode); +std::cerr << "import_symbol 1\n"; + boost::dll::shared_library lib(path, mode); +std::cerr << "import_symbol 1.5\n"; + auto p = boost::dll::detail::make_shared(std::move(lib)); +std::cerr << "import_symbol 2\n"; auto* addr = std::addressof(p->get(name)); +std::cerr << "import_symbol 3\n"; return type(std::move(p), addr); }