Skip to content

andyn/libdlmm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libdlmm-0.3

About the library

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.

Usage

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;
    }
}

Author(s)

Antti Nilakari antti.nilakari@gmail.com

License

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.

About

C++ wrapper for POSIX libdl (dlfcn.h, -ldl)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published