使用sqlite版本sqlite-3070602. 下载已经预编译处理过的版本sqlite-preprocessed-3071100.zip,导入.h,.c文件,直接编译会有一些错误,做如下改动就能编译通过
1. 移除tclsqlite.c, tclsqlite.c用于生成基于TCL的API,如果需要编译,则需要另外下载tcl.h头文件;
2. fts3*.c是全文索引的模块;
打开菜单->Project->Settings->C/C++ -> Preprocessor definitions,添加如下4个编译选项
sqlITE_CORE
sqlITE_ENABLE_RTREE
sqlITE_ENABLE_COLUMN_MetaDATA
sqlITE_ENABLE_FTS3
3. rTree.h是建立数据库R树索引的模块的头文件,不知什么原因代码里include的是sqlite3rtree.h,改成rtree.h
4. shell.c用于生成命令行模式的sqlite.exe;
##################################
sqlite LIB,DLL
1. download header files,lib files and dll files
We need following files
sqlite3.h
sqlite3ext.h
sqlite3.def
sqlite3.dll
convert the def file to lib file
C:/>LIB /DEF:sqlite3.def /machine:IX86
LIB.exe: The Microsoft Library Manager (LIB.exe)
It creates and manages a library of Common Object File Format (COFF) object files. LIB can also be used to create export files and import libraries to reference exported definitions.
def file: A module-definition (.def) file is a text file containing one or more module statements that describe varIoUs attributes of a DLL. If you are not using the __declspec(dllexport) keyword to export the DLL's functions,the DLL requires a .def file. A minimal .def file must contain the following module-definition statements:LIBRARY and EXPORTS. More details please refer to MSDNhttp://msdn.microsoft.com/en-us/library/d91k01sh%28VS.80%29.aspxor google "MSDN def"