|
From: <cn...@us...> - 2009-06-23 04:54:38
|
Revision: 362
http://hgengine.svn.sourceforge.net/hgengine/?rev=362&view=rev
Author: cnlohr
Date: 2009-06-23 04:54:38 +0000 (Tue, 23 Jun 2009)
Log Message:
-----------
be more descriptive, especially when something goes wrong, report the linking error.
Modified Paths:
--------------
Mercury2/src/ModuleManager.cpp
Modified: Mercury2/src/ModuleManager.cpp
===================================================================
--- Mercury2/src/ModuleManager.cpp 2009-06-23 04:54:16 UTC (rev 361)
+++ Mercury2/src/ModuleManager.cpp 2009-06-23 04:54:38 UTC (rev 362)
@@ -38,12 +38,13 @@
{
XMLDocument* doc = XMLDocument::Load("modules.xml");
XMLNode r = doc->GetRootNode();
- for (XMLNode child = r.Child(); child.IsValid(); child = r.NextNode())
+ for (XMLNode child = r.Child(); child.IsValid(); child = child.NextNode())
{
if( child.Name() != "Module" )
{
fprintf( stderr, "Invalid element in modules: %s\n", child.Name().c_str() );
}
+ printf( "Loading: %s\n", child.Attribute( "obj" ).c_str() );
#ifdef WIN32
MString ModuleName = child.Attribute( "obj" ) + ".dll";
#else
@@ -63,11 +64,13 @@
bool ModuleManager::LoadModule( const MString & ModuleName, const MString & LoadFunction )
{
if( m_hAllHandles[ModuleName] ) UnloadModule( ModuleName );
- m_hAllHandles[ModuleName] = dlopen( ModuleName.c_str(), RTLD_NOW | RTLD_GLOBAL );
+ void * v = dlopen( ModuleName.c_str(), RTLD_NOW | RTLD_GLOBAL );
+ m_hAllHandles[ModuleName] = v;
+
if( !m_hAllHandles[ModuleName] )
{
- fprintf( stderr, "Error opening: %s\n", ModuleName.c_str() );
+ fprintf( stderr, "Error opening: %s (%s)\n", ModuleName.c_str(), dlerror() );
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|