????p.done();//???????done?????so?к???????????????dlsym??done?????????? err = dlerror(); dlclose(dp);}model1.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dll.h"

void done(){
    printf("This is test module 1! ");
}

void init(dll *p){
    p->name = (char *)calloc(3?? sizeof(char));
    strcpy(p->name?? "so1");
    p->done = done;
}

????model1.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dll.h"

void done(){
    printf("This is test module 2! ");
}

void init(dll *p){
    p->name = (char *)calloc(3?? sizeof(char));
    strcpy(p->name?? "so2");
    p->done = done;
}

????dll.h ????

typedef struct dll{
    char * name;
    void (*done)() ;
}dll;

?????????gcc????????

gcc -rdynamic -o test  test.c dll.h -ldl  //-ldl (???dl??)???dlopen??dlsym??dl????
gcc -shared -o module1.so  module1.c dll.h
gcc -shared -o $module2.so module2.c dll.h

??????????????????????ò????dll?е??????