sqlite3-sqlite3.o: In function `unixDlSym‘:

移植sqlite3到ARM开发板遇到的问题

sqlite3-sqlite3.o: In function `unixDlSym':
/home/sqlite/sqlite-autoconf-3330000/sqlite3.c:40021: undefined reference to `dlsym'
sqlite3-sqlite3.o: In function `fts5Bm25GetData':
/home/sqlite/sqlite-autoconf-3330000/sqlite3.c:211430: undefined reference to `log'
sqlite3-sqlite3.o: In function `unixDlClose':
/home/sqlite/sqlite-autoconf-3330000/sqlite3.c:40025: undefined reference to `dlclose'
sqlite3-sqlite3.o: In function `unixDlError':
/home/sqlite/sqlite-autoconf-3330000/sqlite3.c:39994: undefined reference to `dlerror'
sqlite3-sqlite3.o: In function `unixDlOpen':
/home/sqlite/sqlite-autoconf-3330000/sqlite3.c:39980: undefined reference to `dlopen'
collect2: ld returned 1 exit status

分析错误原因:
没有链接dl库,如果你的程序中使用dlopen、dlsym、dlclose、dlerror 显示加载动态库,需要设置链接选项 -ldl
解决方法
进入Makefile
/usr/local/arm/opt/FriendlyARM/toolschain/4.4.3/bin/…/arm-none-linux-gnueabi//sys-root/usr/lib/libdl.so: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [Makefile:453:libsqlite3.la] 错误 1在这里插入图片描述
make然后又双叒报了一个错误

/usr/local/arm/opt/FriendlyARM/toolschain/4.4.3/bin/…/arm-none-linux-gnueabi//sys-root/usr/lib/libdl.so: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [Makefile:453:libsqlite3.la] 错误 1

说是libdl.so无法识别
进入交叉编译器目录查看库文件是否正常
在这里插入图片描述
然鹅并没有libdl.so动态库 坑爹!!!

那么最终解决方法
使用较新的交叉编译器,因为新版的交叉编译器库比较齐全

安装新版交叉编译器

我们都知道Ubuntu有一个专门用来安装软件的工具apt,我们可以用它来全自动安装arm-linux-gcc。
此方法安装的是最新版的,但是此方法需要翻墙,否则99%会失败,这就是为什么网上大多都用压缩包安装的原因:
首先Ctrl+Alt+T弹出终端,使用如下命令进行arm-linux-gcc的安装:

sudo apt-get install gcc-arm-linux-gnueabihf

使用如下命令进行arm-linux-g++的安装:

sudo apt-get install g++-arm-linux-gnueabihf

如果要卸载时使用如下命令进行移除,arm-linux-gcc的卸载:

sudo apt-get remove gcc-arm-linux-gnueabihf

arm-linux-g++的卸载:

sudo apt-get remove g++-arm-linux-gnueabihf

也可以使用4.6.2版本的交叉编译器
链接:https://pan.baidu.com/s/1l8k0XWL8RMTn5oVasPABrg
提取码:kz2r
复制这段内容后打开百度网盘手机App,操作更方便哦

具体交叉编译器的配置方法有些简单,在此不再赘述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值