gcc编译出现dlopen、dlerror、dlsym、dlcolse的解决方法
➜ 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库
如图
如果说我的文章对你有用,只不过是我站在巨人的肩膀上再继续努力罢了。
若在页首无特别声明,本篇文章由 Schips 经过整理后发布。
博客地址:https://www.cnblogs.com/schips/
若在页首无特别声明,本篇文章由 Schips 经过整理后发布。
博客地址:https://www.cnblogs.com/schips/