C????????????
???????????? ???????[ 2013/2/26 9:50:48 ] ????????
????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?е??????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11