Giter Club home page Giter Club logo

rll's Introduction

Before you open an issue please check out the common issues section of the ReadMe.

RLL

RLL is a multi-platform, thread-safe, runtime dynamic/shared library loader. Its name stands for exactly what it does: Runtime Library Loader. It's light (<300 lines of code) and is header-only library. And best of all it's public domain!

Care for an example?

#include <RLL/RLL.hpp>

int main(){
    rll::shared_library my_lib;

    try {
        my_lib.load("./my_lib.so");
        // OR
        // my_lib.load([path], [loader_flags])
    } catch (rll::exception::library_loading_error& e) {
        // Handle exceptions.
    }

    if(test_lib.has_symbol("add")){
        add_function = test_lib.get_function_symbol<int(int, int)>("add"));
    }
}

RLL is unit tested for safety and code reliability.

Requirements:

A C++11 supported compiler. There is a C++98 supported branch that mirrors version 1.0.0 with the needed changes and hotfixes.

Dependencies:

The only dependency RLL has is the dl library when you are compiling on a POSIX system, i.e. Linux or Mac. This can be easily remedied with something like:

if(NOT WIN32)
    target_link_libraries(${my_target} PRIVATE dl)
endif()

if you are using CMake.

I just wanna jump into it!

The docs are generated with Doxygen and can be easily accessed in the docs/ folder. Be sure to checkout the common issues area if you run into an issues. And let me know any other issues via opening an issue, or maybe even a PR.

Common issues:

Symbol visibility:

  • On Windows (as with and DLL with exports) you must explicitly export symbols via a build system configuration, or __declspec.
  • With GCC/Clang most symbols are visible by default, but certain are not including non-extern const variables.

For more information on symbol visibility in the global scope checkout this wonderful article by Federico Kircheis.

Not using extern "C" for C++ libraries:

C++ names are "mangled" to allow for multiple symbols with the same name in source code. This allows for namespaces and templates among other things. Reversing name-mangling may be a future RLL feature, but it isn't a priority right now as name mangling is non-standard compiler implemented.

Not linking dl:

It's important that on POSIX (Unix-like) systems you link dl. It is the system library that allows you to load shared libraries. If you don't link it you will get undefined symbol errors.

SEG FAULT:

I can't really help you with that. You are going to need a debugger.

Licensure:

PUBLIC DOMAIN!!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.