SQLite是一款轻量级的本地数据库,支持Windows/Linux/Unix等等主流的操作系统,同时支持很多程序语言,比如 C++、C#、PHP、Java等
本篇主要讲述如何在Windows下编译和使用SQLite数据库。
一、编译准备
1、下载SQLite源代码:选择sqlite-amalgamation-X.zip,后面是版本号
二、编译过程
1、打开VC新建一个 Win32 DLL 空工程,命名为 sqlite3
2、解压sqlite-amalgamation-X.zip,把sqlite3.h、sqlite3ext.h、sqlite3.c添加到工程项目中
5、修改配置,在项目属性,常规下的配置类型,将动态库(.dll)改成静态库(.lib)
6、编译,然后在编译目录中找到sqlite3.lib
三、在项目中使用SQLite
1、新建一个win32 控制台应用程序,命名为sqlitetest
2、把sqlite3.h、sqlite3ext.h复制到工程目录下&