Exemplo n.º 1
0
 /* opens a shared library */
 lib_t openLibrary(const std::string& file)
 {
   std::string fullName = file+".dll";
   HMODULE handle = LoadLibraryA(fullName.c_str());
   if (handle) return lib_t(handle);
   handle = LoadLibrary((getExecutableFileName() + fullName).c_str());
   return lib_t(handle);
 }
Exemplo n.º 2
0
  /* opens a shared library */
  lib_t openLibrary(const std::string& file)
  {
#if defined(__MACOSX__)
    std::string fullName = "lib"+file+".dylib";
#else
    std::string fullName = "lib"+file+".so";
#endif
    void* lib = dlopen(fullName.c_str(),RTLD_NOW);
    if (lib) return lib_t(lib);
    lib = dlopen((getExecutableFileName() + fullName).c_str(),RTLD_NOW);
    return lib_t(lib);
  }
Exemplo n.º 3
0
  /* opens a shared library */
  lib_t openLibrary(const std::string& file)
  {
#if defined(__MACOSX__)
    std::string fullName = "lib"+file+".dylib";
#else
    std::string fullName = "lib"+file+".so";
#endif
    void* lib = dlopen(fullName.c_str(), RTLD_NOW);
    if (lib) return lib_t(lib);
    FileName executable = getExecutableFileName();
    lib = dlopen((executable.path() + fullName).c_str(),RTLD_NOW);
    if (lib == NULL) THROW_RUNTIME_ERROR(dlerror());
    return lib_t(lib);
  }
Exemplo n.º 4
0
 /* opens a shared library */
 lib_t openLibrary(const std::string& file)
 {
   std::string fullName = file+".dll";
   FileName executable = getExecutableFileName();
   HANDLE handle = LoadLibrary((executable.path() + fullName).c_str());
   return lib_t(handle);
 }