Libdlmm is a thin wrapper for POSIX libdl (dlopen, dlsym, dlclose, dlerror, linked with -ldl). GNU dlvsym is also supported.
The name libdlmm is derived from other projects (namely gtkmm) that provide C++ wrappers for C libraries.
Link with -ldl. A simple usage example is illustrated below.
#include <dlmm.hh>
#include <iostream>
int main(void) {
try {
Dl dl("some_library.so");
std::cout << dl.symbol<int>("variable_name") << std::endl;
std::cout << dl.symbol<int(std::string const &, int)>("function_name")("a", 1) << std::endl;
}
catch (std::runtime_error e) {
std::cerr << "Library error" << std::endl;
return 1;
}
}
Antti Nilakari [email protected]
No warranty is given. You are at your own risk. You have been warned.
You are allowed to use and redistribute this library wrapper and all accompanying material as you see fit. However, linking your program against libdl likely requires you to adhere to its license.