2011-05-27 01:16:58 +04:00
|
|
|
|
|
|
|
#include "framework.h"
|
|
|
|
#include "shared.h"
|
2011-05-31 23:17:01 +04:00
|
|
|
#include "stdio.h"
|
2011-05-27 01:16:58 +04:00
|
|
|
|
|
|
|
#if defined(WIN32)
|
|
|
|
#include <windows.h>
|
|
|
|
#else
|
|
|
|
#include "dlfcn.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(int, char**)
|
|
|
|
{
|
|
|
|
framework();
|
|
|
|
shared();
|
|
|
|
|
|
|
|
#if defined(WIN32)
|
2011-06-02 19:08:49 +04:00
|
|
|
HANDLE lib = LoadLibraryA("module1.dll");
|
2011-06-01 20:59:34 +04:00
|
|
|
if(!lib)
|
|
|
|
{
|
2011-06-02 19:08:49 +04:00
|
|
|
printf("Failed to open module1\n");
|
2011-06-01 20:59:34 +04:00
|
|
|
}
|
2011-05-27 01:16:58 +04:00
|
|
|
#else
|
2011-06-02 19:08:49 +04:00
|
|
|
void* lib = dlopen("module1.so", RTLD_LAZY);
|
2011-05-31 23:17:01 +04:00
|
|
|
if(!lib)
|
|
|
|
{
|
2011-06-02 19:08:49 +04:00
|
|
|
printf("Failed to open module1\n%s\n", dlerror());
|
2011-05-31 23:17:01 +04:00
|
|
|
}
|
2011-06-01 20:59:34 +04:00
|
|
|
#endif
|
|
|
|
|
2011-05-31 23:17:01 +04:00
|
|
|
|
2011-05-27 01:16:58 +04:00
|
|
|
return lib == 0 ? 1 : 0;
|
|
|
|
}
|