Changeset 7171 in orxonox.OLD for branches/shared_lib/src/util/loading
- Timestamp:
- Feb 20, 2006, 2:29:02 PM (19 years ago)
- Location:
- branches/shared_lib/src/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/shared_lib/src/util/loading/dynamic_loader.cc
r7169 r7171 17 17 18 18 #include "dynamic_loader.h" 19 20 21 #include <dlfcn.h>22 19 23 20 … … 47 44 // delete what has to be deleted here 48 45 if (this->handle != NULL) 49 dlclose(this->handle);46 lt_dlclose(this->handle); 50 47 } 51 48 … … 53 50 bool DynamicLoader::loadDynamicLib(const std::string& libName) 54 51 { 55 this->handle = dlopen(&libName[0], RTLD_NOW); 52 if (lt_dlinit () != 0) 53 { 54 PRINTF(1)("Initializing LT_DL_LIB\n"); 55 } 56 this->handle = lt_dlopen(&libName[0]); 56 57 if(this->handle == NULL) 57 58 { 58 59 return false; 59 60 } 60 void *mkr = dlsym( this->handle, "maker");61 //void *mkr = dlsym( this->handle, "maker"); 61 62 } 62 63 63 64 bool DynamicLoader::loadDyLib(const char* libName) 64 65 { 66 if (lt_dlinit () != 0) 67 { 68 PRINTF(1)("Initializing LT_DL_LIB\n"); 69 } 70 65 71 void* handle; 66 handle = dlopen(libName, RTLD_NOW);72 handle = lt_dlopen(libName); 67 73 if(handle == NULL) 68 74 { 69 PRINTF(1)("unable to load %s: %s\n", libName, dlerror());75 PRINTF(1)("unable to load %s: %s\n", libName, lt_dlerror()); 70 76 71 77 return false; -
branches/shared_lib/src/util/loading/dynamic_loader.h
r7169 r7171 8 8 9 9 #include "factory.h" 10 #include <ltdl.h> 10 11 11 12 #include <string> … … 28 29 29 30 private: 30 void*handle;31 lt_dlhandle handle; 31 32 }; 32 33
Note: See TracChangeset
for help on using the changeset viewer.