/***********编译时要链接 -l dl 库************/<br></br><br></br>#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
#include"person.h"
#include<memory.h>
#include<string.h>
#include<dlfcn.h>
int main(){

typedef int (*SELECT)(PERSON*);
typedef void (*ADD)(int ,PERSON*);
    void *handle;
    if((handle=dlopen("./libper.so",RTLD_LAZY/*RTLD_NOW*/))==NULL){
        printf("load so fail");
    }
     ADD add=(ADD)dlsym(handle,"addperson"); dlclose(handle);
}

标签: linux, handle, int, include, 调用, typedef

相关文章推荐

添加新评论,含*的栏目为必填