blob: 17eac02c9ddd8f4dc7d649dd0f36ff3710f37c96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include "ModuleLoader.hpp"
#include "Base.hpp"
#include "Common.hpp"
#include <vector>
#include <string>
#include <iostream>
using namespace std;
int main( void )
{
try {
Common &c = Common::instance( );
c.setName( "test3" );
vector<string> modules;
#ifndef _WIN32
modules.push_back( "./testmod3/mod_test3.so" );
#else
modules.push_back( ".\\testmod3\\mod_test3.dll" );
#endif
ModuleLoader<Base> 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;
}
|