Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
autorake / examples / dlcpp / main.cpp
Size: Mime:
//
//  main.cpp  --  Load a dynamic library and call an exported function
//

#include "dl.h"
#include <iostream>

int main( int argc, const char *argv)
{
    try {
        Dl dl( "./hello.so");

        void (*f)( void) = (void (*)( void)) dl.sym( "hello");

        (*f)();
        return 0;
    }
    catch (Dl::Error &e) {
        std::cerr << (const char *) e << "\n";
        return 1;
    }
}