首先要在sqlite3.c中最前面,添加代码(网上有说在sqlite3.h中添加也可,实际测试在sqlite3.h中打开该宏是无效的):
#ifndef sqlITE_HAS_CODEC #define sqlITE_HAS_CODEC #endif |
这个宏是用来确定是否支持加密的。添加上述代码后编译,会出现如下错误:
D:\Research\MysqLite\Debug/../src/sqlite3.c:80963: undefined reference to `sqlite3CodecAttach' D:\Research\MysqLite\Debug/../src/sqlite3.c:80968: undefined reference to `sqlite3CodecGetKey' D:\Research\MysqLite\Debug/../src/sqlite3.c:80970: undefined reference to `sqlite3CodecAttach' src\sqlite3.o: In function `sqlite3Pragma': D:\Research\MysqLite\Debug/../src/sqlite3.c:94023: undefined reference to `sqlite3_key' D:\Research\MysqLite\Debug/../src/sqlite3.c:94026: undefined reference to `sqlite3_rekey' D:\Research\MysqLite\Debug/../src/sqlite3.c:94038: undefined reference to `sqlite3_key' D:\Research\MysqLite\Debug/../src/sqlite3.c:94040: undefined reference to `sqlite3_rekey' D:\Research\MysqLite\Debug/../src/sqlite3.c:94048: undefined reference to `sqlite3_activate_see' src\sqlite3.o: In function `sqlite3RunVacuum': D:\Research\MysqLite\Debug/../src/sqlite3.c:101744: undefined reference to `sqlite3CodecGetKey' |