blob: 1d00b803c9fbedfd2b2a8d387e775733daa086f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// compile with gcc -ldl -o libtest libtest.c
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const* argv[])
{
void *handle;
handle = dlopen(argv[1], RTLD_NOW);
if(!handle) {
fprintf(stderr, "%s\n", dlerror());
return 1;
}
dlclose(handle);
return 0;
}
|