dltest.c
来自「linux下用PCMCIA无线网卡虚拟无线AP的程序源码」· C语言 代码 · 共 40 行
C
40 行
#include <fcntl.h>#include <stdlib.h>#include <stdio.h>#include <dlfcn.h>extern void _dlinfo();int main(int argc, char **argv) { void *handle; int (*myhowdy)(const char *s); char *error;#ifdef __UCLIBC__ _dlinfo(); /* not supported by ld.so.2 */#endif handle = dlopen ("./libhowdy.so", RTLD_LAZY); if (!handle) { fputs (dlerror(), stderr); exit(1); } myhowdy = dlsym(handle, "howdy"); if ((error = dlerror()) != NULL) { fputs(error, stderr); exit(1); } myhowdy("hello world!\n");#ifdef __UCLIBC__ _dlinfo(); /* not supported by ld.so.2 */#endif dlclose(handle); return EXIT_SUCCESS;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?