comparison 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
comparison
equal deleted inserted replaced
292:2fc6456b1c71 293:a331172e11ba
268 VampGetPluginDescriptorFunction fn = 268 VampGetPluginDescriptorFunction fn =
269 (VampGetPluginDescriptorFunction)lookupInLibrary 269 (VampGetPluginDescriptorFunction)lookupInLibrary
270 (handle, "vampGetPluginDescriptor"); 270 (handle, "vampGetPluginDescriptor");
271 271
272 if (!fn) { 272 if (!fn) {
273 if (forPlugin != "") {
274 cerr << "Vamp::HostExt::PluginLoader: No vampGetPluginDescriptor function found in library \""
275 << fullPath << "\"" << endl;
276 }
273 unloadLibrary(handle); 277 unloadLibrary(handle);
274 continue; 278 continue;
275 } 279 }
276 280
277 int index = 0; 281 int index = 0;
363 << key << "\" in loadPlugin" << std::endl; 367 << key << "\" in loadPlugin" << std::endl;
364 return 0; 368 return 0;
365 } 369 }
366 370
367 string fullPath = getLibraryPathForPlugin(key); 371 string fullPath = getLibraryPathForPlugin(key);
368 if (fullPath == "") return 0; 372 if (fullPath == "") {
373 std::cerr << "Vamp::HostExt::PluginLoader: No valid \""
374 << libname << "." << PLUGIN_SUFFIX
375 << "\" found in Vamp path" << std::endl;
376 return 0;
377 }
369 378
370 void *handle = loadLibrary(fullPath); 379 void *handle = loadLibrary(fullPath);
371 if (!handle) return 0; 380 if (!handle) return 0;
372 381
373 VampGetPluginDescriptorFunction fn = 382 VampGetPluginDescriptorFunction fn =
374 (VampGetPluginDescriptorFunction)lookupInLibrary 383 (VampGetPluginDescriptorFunction)lookupInLibrary
375 (handle, "vampGetPluginDescriptor"); 384 (handle, "vampGetPluginDescriptor");
376 385
377 if (!fn) { 386 if (!fn) {
387 cerr << "Vamp::HostExt::PluginLoader: No vampGetPluginDescriptor function found in library \""
388 << fullPath << "\"" << endl;
378 unloadLibrary(handle); 389 unloadLibrary(handle);
379 return 0; 390 return 0;
380 } 391 }
381 392
382 int index = 0; 393 int index = 0;