yyqng

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

代码示例:

#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

typedef int(*Func)(void*);
int callFunc(dtInterp_t a)
{
    void* handle = dlopen("*.so", RTLD_LAZY);
    Func func = (Func)dlsym(handle, "funcName");
    func(a);
    dlclose(handle);
    return 0;
}

 

posted on 2023-05-05 08:46  zziii  阅读(257)  评论(0编辑  收藏  举报