dynamic_library.h 458 B

123456789101112131415161718192021222324
  1. #ifndef DYNAMIC_LIBRAY_H
  2. #define DYNAMIC_LIBRAY_H
  3. #if defined(WIN32)
  4. #define DYNLIB_FOR_OS(fn) #fn ".dll"
  5. #elif defined(__APPLE__)
  6. #define DYNLIB_FOR_OS(fn) #fn ".dylib"
  7. #else
  8. #define DYNLIB_FOR_OS(fn) #fn ".so"
  9. #endif
  10. class DynamicLibrary
  11. {
  12. protected:
  13. void * handleLib;
  14. public:
  15. DynamicLibrary ();
  16. virtual ~ DynamicLibrary ();
  17. bool open (char const * libname);
  18. bool close ();
  19. void * dlsym (char const * sym_name);
  20. };
  21. #endif //DYNAMIC_LIBRAY_H