➜ test_sqlite3 gcc *.c -I . -o xixi -pthread
/tmp/cckGKTrr.o: In function `unixDlOpen':
sqlite3.c:(.text+0x1124d): undefined reference to `dlopen'
/tmp/cckGKTrr.o: In function `unixDlError':
sqlite3.c:(.text+0x1126c): undefined reference to `dlerror'
/tmp/cckGKTrr.o: In function `unixDlSym':
sqlite3.c:(.text+0x112bb): undefined reference to `dlsym'
/tmp/cckGKTrr.o: In function `unixDlClose':
sqlite3.c:(.text+0x112f1): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
在头文件中、加入
#include <dlfcn.h>
编译时,链接
dl库
如图
![gcc编译出现dlopen、dlerror、dlsym、dlcolse的解决方法 gcc编译出现dlopen、dlerror、dlsym、dlcolse的解决方法](https://image.shishitao.com:8440/aHR0cHM6Ly93d3cuc2h1emhpZHVvLmNvbS9Vc2Vycy9TQ0hJUFMvQXBwRGF0YS9Mb2NhbC9UZW1wL2VuaHRtbGNsaXAvSW1hZ2UoMikucG5n.png?w=700&webp=1)