Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 1.25 KB

File metadata and controls

32 lines (27 loc) · 1.25 KB

DLManager

Purpose

To provide a simple way to dyamically load dynamic libraries across multiple platforms.

Currently tested Platforms

  • Windows:
  • Linux and MacOS:

Adding to your project

DLManager is a header only library, so you only need
#include "DLManager.h".
However, in order to link, you might need a flag for your compiler.

DLManager uses dlopen on Linux, so you would need to pass -ldl to your compiler. If using cmake, you can instruct it to do that with: target_link_libraries(target ${CMAKE_DL_LIBS}) replacing target with your cmake target.

Using DLManager

Each platform may require different workflows in order for DLManager to work properly, especially with name mangling.

For GCC, you can use extern "C" before a non-member function.

extern "C" void hello(){
    std::cout << "Hello!" << std::endl;
}

Then you can access it by passing "hello" as the name to getFunction.
Check out our examples for demonstrations