Git Product home page Git Product logo

libload's Introduction

libload

This simple C library provides cross-platform interface to load dynamic (aka 'shared') libraries in runtime. Flags are currently optimized for loading local libraries, making it possible to be used in plugin development (C ABI is the most popular plugin binary interface).

Currently runs on Windows and Linux. Linux interface is supposed to be POSIX-compatible. Compilation flags are strict.

Example

An example can be found at tests/overview. It is an example of project with a library, loaded at runtime.

To be short, the library only provides functions:

  • libloadfile - loads library file in runtime.
  • libloadsymbol - loads function or global variable.
  • libloadfinish - terminates the library.

Build

This project uses CMake build system:

cmake -B build
cmake --build build
cd build && ctest

The build output can be found at build/libload/

Notes

Why do library must have .so extension?

Windows is able to append .dll automatically, dl is unable. Also that is why library has to be allocated in array, not as just string literal.

Why Windows flags do not contain /Wall option?

Windows.h does not meet /Wall requirements. But if I use libloaderapi.h instead of Windows.h, I get No target architecture error. If you know the solution, I am ready to integrate it.

libload's People

Contributors

makaleks avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.