#include "ModuleLoader.hpp" #include "Base.hpp" #include "Common.hpp" #include #include #include using namespace std; int main( void ) { try { Common &c = Common::instance( ); c.setName( "test3" ); vector modules; #ifndef _WIN32 modules.push_back( "./testmod3/mod_test3.so" ); #else modules.push_back( ".\\testmod3\\mod_test3.dll" ); #endif ModuleLoader loader( modules ); Base *obj = loader.create( "testmod3" ); c.print( "hello from main" ); obj->hello( ); loader.destroy( obj ); } catch( exception &e ) { cerr << "Module loader error: " << e.what( ); return 1; } return 0; }