diff --git a/plugin.hpp b/plugin.hpp index 82a39fd..0c56cf6 100644 --- a/plugin.hpp +++ b/plugin.hpp @@ -14,9 +14,9 @@ #include #include #include - #include #include +#include namespace sc { @@ -32,10 +32,9 @@ namespace sc { std::string plugname {info->d_name}; std::string::size_type lastdot = plugname.rfind("."); if (plugname.substr(lastdot + 1) == ext) { - + plugin plugin {dir + '/' + plugname}; + plugins.emplace(plugname.substr(0, lastdot), std::move(plugin)); } - plugin plugin {dir + '/' + plugname}; - plugins.emplace(plugname.substr(0, lastdot), std::move(plugin)); } } throw_if_min1(::closedir(plugins_dir)); @@ -62,6 +61,7 @@ namespace sc { plugin(const std::string& path) : _path {path} { _plugin = ::dlopen(path.c_str(), RTLD_LAZY); + //std::cerr << path << (_plugin ? "" : " not") << " opened\n"; const char* err {::dlerror()}; if (err) std::cerr << err << '\n';