Skip to content

A single-header library to take away the pain of loading a dll. Crossplatform!

License

Notifications You must be signed in to change notification settings

Xoronic/dll_loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

dll_loader

A single-header library to take away the pain of loading a dynamically linked library. Crossplatform!
Disclaimer: I don't consider it production-ready, it is not tested very heavily and it lacks some features.

Installation

Just download the headerfile, add it to your project directory and include it. That's all!

Usage

Simple example usage to get started:

#include "dll_loader.hpp"
#include <iostream>

int main() {
  // Load the library with the name 'testdll'
  auto lib = dll_loader::dynamic_library("testdll");

  // Get a function from the library named 'get_one', 
  // which takes no parameters and returns an integer.
  auto get_one = lib.get_function<int()>("get_one");

  // Get a function from the library named 'get_a_string',
  // Which takes not parameters and returns a const char*.
  auto get_a_string = lib.get_function<const char*()>("get_a_string");

  // We can just call these functions now:
  std::cout << get_one() << std::endl;

  std::cin.get();
}

Support

Please open an issue for support.

Contributing

Create a branch, add commits, and open a pull request.

About

A single-header library to take away the pain of loading a dll. Crossplatform!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages