以下链接是SQLite官网
命令行例子:
https://www.sqlite.org/cli.html
C语言例子:
https://www.sqlite.org/quickstart.html
照着例子自己写的程序编译有错误:
C文件中加入头文件:
#include<sqlite3.h>
编译出现以下错误:
现象1:
fatal error sqlite3.h
原因:找不到头文件,系统没有安装库函数;
解决办法:ubuntu 安装 libsqlite3-dev
sudo apt-get install libsqlite3-dev
现象2:
undefined reference to `sqlite3_open’
原因:找不到链接库函数
解决方法:加入连接库-lsqilte3
gcc test.c -o test -lsqlite3