diff src/vamp-hostsdk/PluginLoader.cpp @ 293:a331172e11ba

* Improve error reporting from PluginLoader
author cannam
date Tue, 22 Sep 2009 10:39:36 +0000
parents c97e70ed5abc
children 0e08ebd5c13b
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginLoader.cpp	Tue Sep 22 10:08:01 2009 +0000
+++ b/src/vamp-hostsdk/PluginLoader.cpp	Tue Sep 22 10:39:36 2009 +0000
@@ -270,6 +270,10 @@
                 (handle, "vampGetPluginDescriptor");
             
             if (!fn) {
+                if (forPlugin != "") {
+                    cerr << "Vamp::HostExt::PluginLoader: No vampGetPluginDescriptor function found in library \""
+                         << fullPath << "\"" << endl;
+                }
                 unloadLibrary(handle);
                 continue;
             }
@@ -365,7 +369,12 @@
     }
         
     string fullPath = getLibraryPathForPlugin(key);
-    if (fullPath == "") return 0;
+    if (fullPath == "") {
+        std::cerr << "Vamp::HostExt::PluginLoader: No valid \""
+                  << libname << "." << PLUGIN_SUFFIX
+                  << "\" found in Vamp path" << std::endl;
+        return 0;
+    }
     
     void *handle = loadLibrary(fullPath);
     if (!handle) return 0;
@@ -375,6 +384,8 @@
         (handle, "vampGetPluginDescriptor");
 
     if (!fn) {
+        cerr << "Vamp::HostExt::PluginLoader: No vampGetPluginDescriptor function found in library \""
+             << fullPath << "\"" << endl;
         unloadLibrary(handle);
         return 0;
     }