/*头文件*/
#include<dlfcn.h>
void *handle;
handle = dlopen("libKeyDerive.so",RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND);
if (!handle)
{
return ( -1 );
}
/*定义库中需要调用的接口*/
typedef int (*https_client_batchpost)(char *info,int infolen,char *resp);
https_client_batchpost batchpost_func = dlsym(handle, "https_client_batchpost");
if (batchpost_func)
{
i_ret = batchpost_func(batchinfo,strlen(batchinfo),&responseinfo);
}
else
{
dlclose(handle);
return ( -1 );
}
dlclose(handle);
dlopen调用动态库
最新推荐文章于 2024-08-02 11:05:37 发布