104bool mp::FactoryFilter::add_creator_dl(
const std::string &fi,
105 const std::string &path)
108 if (m_p->m_fcm.find(fi) != m_p->m_fcm.end())
112 std::string full_name =
"metaproxy_1_filter_" + fi;
114 void *dl_handle = dlopen(0, RTLD_GLOBAL|RTLD_NOW);
115 void *dlsym_ptr = dlsym(dl_handle, full_name.c_str());
119 std::string full_path = path +
"/metaproxy_filter_" + fi +
".so";
120 dl_handle = dlopen(full_path.c_str(), RTLD_GLOBAL|RTLD_NOW);
123 const char *dl = dlerror();
124 std::cout <<
"dlopen " << full_path <<
" failed. dlerror=" << dl <<
128 dlsym_ptr = dlsym(dl_handle, full_name.c_str());
132 std::cout <<
"dlsym " << full_name <<
" failed\n";
135 struct metaproxy_1_filter_struct *s = (
struct metaproxy_1_filter_struct *) dlsym_ptr;
136 return add_creator(fi, s->creator);