#include <iostream>
#include <dlfcn.h>
#include "MdcTrkRecon/MdcSegPatterns.h"
Go to the source code of this file.
Functions | |
int | main () |
int main | ( | ) |
Definition at line 5 of file test.cxx.
References genRecEmupikp::i, ganga-rec::j, MdcSegPatterns::npatt3, MdcSegPatterns::npatt4, and MdcSegPatterns::patt3.
00005 { 00006 using std::cout; 00007 using std::cerr; 00008 00009 cout << "C++ dlopen demo\n\n"; 00010 00011 // open the library 00012 cout << "Opening MdcTrkRecon.so...\n"; 00013 void* handle = dlopen("../rh73_gcc32/libMdcTrkRecon.so", RTLD_LAZY); 00014 00015 if (!handle) { 00016 cerr << "Cannot open library: " << dlerror() << '\n'; 00017 return 1; 00018 } 00019 00020 MdcSegPatterns pat(true); 00021 for(int j=0;j<20;j++)std::cout<<pat.patt3[j]<<" "<<j<<std::endl; 00022 for(int i=0;i<256;i++){ 00023 std::cout<<pat.npatt4[i]<<" "<<pat.npatt3[i]<<" "<<i<<std::endl; 00024 } 00025 /* // load the symbol 00026 cout << "Loading symbol hello...\n"; 00027 typedef void (*hello_t)(); 00028 hello_t hello = (hello_t) dlsym(handle, "hello"); 00029 if (!hello) { 00030 cerr << "Cannot load symbol 'hello': " << dlerror() << 00031 '\n'; 00032 dlclose(handle); 00033 return 1; 00034 } 00035 00036 // use it to do the calculation 00037 cout << "Calling hello...\n"; 00038 hello(); 00039 */ 00040 // close the library 00041 cout << "Closing library...\n"; 00042 dlclose(handle); 00043 }