[Jahshaka-cvs] openlibraries/src/openpluginlib/pl openplugin.cpp, 1.5, 1.6
Status: Beta
Brought to you by:
jahshaka
From: Charles Y. <lil...@us...> - 2007-06-26 14:53:01
|
Update of /cvsroot/openlibraries/openlibraries/src/openpluginlib/pl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12776 Modified Files: openplugin.cpp Log Message: + Temporary placement for some logging in case of a so/dll failure to load (logging api to follow) Index: openplugin.cpp =================================================================== RCS file: /cvsroot/openlibraries/openlibraries/src/openpluginlib/pl/openplugin.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- openplugin.cpp 12 Apr 2007 11:01:10 -0000 1.5 +++ openplugin.cpp 26 Jun 2007 14:52:58 -0000 1.6 @@ -8,6 +8,7 @@ #include <algorithm> #include <functional> #include <map> +#include <iostream> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN @@ -103,6 +104,7 @@ { typedef std::vector<wstring>::const_iterator const_iterator; fs::path key = fs::path( to_string( *shared_name.begin( ) ).c_str( ), fs::native ); + std::string error = ""; if ( plugin_cache.find( key ) != plugin_cache.end( ) ) { @@ -120,10 +122,20 @@ resolver.dlopened = true; break; } + else + { +#ifndef WIN32 + error += std::string( dlerror( ) ) + "\n"; +#else + error += to_string( *I ) + "\n"; +#endif + } } if ( resolver.dlopened ) plugin_cache[ key ] = resolver; + else + std::cerr << "Unable to open shared object:" << std::endl << error << std::endl << std::endl; return resolver.dlopened; } |