Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandonki/cross-platform-dlib
https://github.com/brandonki/cross-platform-dlib
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/brandonki/cross-platform-dlib
- Owner: BrandonKi
- License: mit
- Created: 2021-03-03T17:15:17.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-26T22:34:07.000Z (almost 4 years ago)
- Last Synced: 2024-11-10T22:19:36.739Z (2 months ago)
- Language: C++
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cross-platform-dll
Load dynamic libraries at runtime to be used as a "loadable module" of sorts. This is all done through a common interface regardless of operating system(only works on linux and windows so far). Also there is a C interface as well as a C++ interface.
## C++ Example
```cpp
dlib lib("./libwidget1.so");typedef void* (*func)();
func f = reinterpret_cast(lib.get_func("factory"));lib.close_lib();
```## C Example
```c
//dlib_handle is defined in the header file
dlib_handle handle = load_lib("./libwidget1.so");typedef void* (*func)();
func f = (func) get_func(handle, "factory");close_lib(handle);
```There is also a more complete example in test/
The only reason this was made is to help with these two projects and a potential future project
https://github.com/BrandonKi/ARCANE
https://github.com/BrandonKi/BF-Compiler