Example #1
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);
 }
Example #2
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);
 }
Example #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);
    lib = dlopen((getExecutableFileName() + fullName).c_str(),RTLD_NOW);
    return lib_t(lib);
  }
Example #4
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);
  }
Example #5
0
 /*! returns path to executable */
 FileName FileName::executableFolder() {
   return FileName(getExecutableFileName()).path();
 }