00001 #include <iostream>
00002 #include <dlfcn.h>
00003
00004
00005 int main() {
00006 using std::cout;
00007 using std::cerr;
00008
00009 cout << "C++ dlopen demo\n\n";
00010
00011
00012 cout << "Opening TrkBase.so...\n";
00013 void* handle = dlopen("../rh73_gcc32/libTrkBase.so", RTLD_LAZY);
00014
00015 if (!handle) {
00016 cerr << "Cannot open library: " << dlerror() << '\n';
00017 return 1;
00018 }
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 cout << "Closing library...\n";
00037 dlclose(handle);
00038 }
00039