Monday, January 09, 2006

gcc, dlopen and cdecl

Here is a small tutorial about loading .dll-s (.so-s) under linux and the solution to the mangling problem.

shortly : to make available your function written in c++ for dlopen use extern "C" before the function header :

extern "C" void hello() {
std::cout << "hello" << '\n';
}

No comments: