動的共有オブジェクトの作成方法
gcc -fPIC -shared -o a.so a.c
- リンク
普通にリンクすればよい。
- 動的ロード
void *dlopen(const char *path, int mode);
- シンボルのポインタ取得
void *dlsym(void *handle);
- アンロード
int dlclose(void *handle);
- エラー取得
char *dlerror(void);
gcc -fPIC -shared -o a.so a.c
普通にリンクすればよい。
void *dlopen(const char *path, int mode);
void *dlsym(void *handle);
int dlclose(void *handle);
char *dlerror(void);