/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/test/test.cxx

Go to the documentation of this file.
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     // open the library
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 /*    // load the symbol
00021     cout << "Loading symbol hello...\n";
00022     typedef void (*hello_t)();
00023     hello_t hello = (hello_t) dlsym(handle, "hello");
00024     if (!hello) {
00025         cerr << "Cannot load symbol 'hello': " << dlerror() <<
00026             '\n';
00027         dlclose(handle);
00028         return 1;
00029     }
00030     
00031     // use it to do the calculation
00032     cout << "Calling hello...\n";
00033     hello();
00034 */    
00035     // close the library
00036     cout << "Closing library...\n";
00037     dlclose(handle);
00038 }
00039 

Generated on Tue Nov 29 22:58:02 2016 for BOSS_7.0.2 by  doxygen 1.4.7