#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( "test2" ); vector modules; #ifndef _WIN32 modules.push_back( "./testmod2/mod_test2.so" ); #else modules.push_back( ".\\testmod2\\mod_test2.dll" ); #endif ModuleLoader loader( modules ); Base *obj = loader.create( "testmod2" ); c.print( "hello from main" ); obj->hello( ); loader.destroy( obj ); } catch( exception &e ) { cerr << "Module loader error: " << e.what( ); return 1; } return 0; }