#include <dlfcn.h>
#include <pthread.h> 

void* routine(void* arg) 
{
    char *libname;
    libname = "libgtk-3.so.0";
    // libname = "libgtk-x11-2.0.so.0";
    // libname = "libgio-2.0.so";

    void *lib = dlopen(libname, RTLD_LAZY | RTLD_LOCAL);
    dlclose(lib);
    // pthread_key_delete(1);
    return 0; 
}

int main( int argc, char **argv ) 
{ 
    pthread_t tid; 
    pthread_create(&tid, 0, routine, 0); 
    pthread_join(tid, 0); 

    return 0; 
}
