Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7171 in orxonox.OLD for branches/shared_lib/src/util/loading


Ignore:
Timestamp:
Feb 20, 2006, 2:29:02 PM (19 years ago)
Author:
bensch
Message:

dylib: more like in the real world… should work on win too

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  
    1717
    1818#include "dynamic_loader.h"
    19 
    20 
    21 #include <dlfcn.h>
    2219
    2320
     
    4744  // delete what has to be deleted here
    4845  if (this->handle != NULL)
    49     dlclose(this->handle);
     46    lt_dlclose(this->handle);
    5047}
    5148
     
    5350bool DynamicLoader::loadDynamicLib(const std::string& libName)
    5451{
    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]);
    5657  if(this->handle == NULL)
    5758  {
    5859    return false;
    5960  }
    60   void *mkr = dlsym( this->handle, "maker");
     61  //void *mkr = dlsym( this->handle, "maker");
    6162}
    6263
    6364bool DynamicLoader::loadDyLib(const char* libName)
    6465{
     66  if (lt_dlinit () != 0)
     67  {
     68    PRINTF(1)("Initializing LT_DL_LIB\n");
     69  }
     70
    6571  void* handle;
    66   handle = dlopen(libName, RTLD_NOW);
     72  handle = lt_dlopen(libName);
    6773  if(handle == NULL)
    6874  {
    69     PRINTF(1)("unable to load %s: %s\n", libName, dlerror());
     75    PRINTF(1)("unable to load %s: %s\n", libName, lt_dlerror());
    7076
    7177    return false;
  • branches/shared_lib/src/util/loading/dynamic_loader.h

    r7169 r7171  
    88
    99#include "factory.h"
     10#include <ltdl.h>
    1011
    1112#include <string>
     
    2829
    2930private:
    30   void*      handle;
     31  lt_dlhandle      handle;
    3132};
    3233
Note: See TracChangeset for help on using the changeset viewer.