加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

sqlite3 改源代码支持上下键查询历史命令

发布时间:2020-12-12 20:30:07 所属栏目:百科 来源:网络整理
导读:1、在shell.c的前面加上此宏#define HAVE_READLINE==12、重新运行./configure 生成新的 makefile3、如果有找不到“readline.h”等类似头文件的时候,安装libreadline-dev 和libreadline库问题解决。编译后再次运行sqlite3 命令就可以使用上下方向键了,之前


1、在shell.c的前面加上此宏
#define HAVE_READLINE==1
2、重新运行./configure 生成新的 makefile
3、如果有找不到“readline.h”等类似头文件的时候,安装libreadline-dev 和libreadline库问题解决。

编译后再次运行sqlite3 命令就可以使用上下方向键了,之前输入过的命令就不用再输入了。



出现类似错误时:

libreadline.so: undefined reference to `tgetnum'
libreadline.so: undefined reference to `tgoto'libreadline.so: undefined reference to `tgetflag'
libreadline.so: undefined reference to `BC'
libreadline.so: undefined reference to `tputs'
libreadline.so: undefined reference to `PC'
libreadline.so: undefined reference to `tgetent'
libreadline.so: undefined reference to `UP'
libreadline.so: undefined reference to `tgetstr
这个是由于没有链接 ncurses库,只要加上 -lncurses就可以了



用arm-linux-gcc把ncurses编译后把库文件放到 交叉编译器的lib目录中,就解决了。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读