+void Config_ModuleReader::loadLibrary(const std::string theLibName)
+{
+ std::string aFileName = library(theLibName);
+ if (aFileName.empty())
+ return;
+
+#ifdef WIN32
+ HINSTANCE aModLib = ::LoadLibrary(aFileName.c_str());
+ if (!aModLib) {
+ std::string errorMsg = "Failed to load " + aFileName;
+ std::cerr << errorMsg << std::endl;
+ Events_Error::send(errorMsg);
+ }
+#else
+ void* aModLib = dlopen( aFileName.c_str(), RTLD_LAZY | RTLD_GLOBAL );
+ if ( !aModLib ) {
+ std::cerr << "Failed to load " << aFileName.c_str() << std::endl;
+ }
+#endif
+}
+