`
arust
  • 浏览: 93481 次
  • 性别: Icon_minigender_1
  • 来自: 海底
社区版块
存档分类
最新评论

编译 SQLite3

阅读更多

SQLite 官方提供的编译方法:
http://www.sqlite.org/cvstrac/wiki?p=HowToCompile


引用
MSVC and SQLite DLL
Creation of an import library from the sqlitedll.zip (http://www.sqlite.org/sqlitedll.zip) for MS Visual C++ is achieved by the following command:

LIB /DEF:sqlite3.def

This makes the files sqlite3.lib and sqlite3.exp files. The sqlite3.lib can then be used to link your programs against the SQLite DLL.

If you are using Visual C++ 6.0, you might also want to check #3057 for ways to work around an optimizer bug in the compiler.




这样生成的静态库是需要 dll 文件的。所以我一直没明白官方提供的方法意义何在?

如果想要一个独立的 sqlite3.lib,可以这样做:
下载最新版本的 sqlite3 源代码,sqlite-amalgamation-3.x.xx.tar.gz。
sqlite3 源代码有好几个版本,amalgamation 版最适合集成到自己的工程中使用,它把所有的源代码都放入一个文件当中,在 sqlite3.c 这个含有 10 万多行代码的文件中包含了一切,直接编译它就可以生成一个独立的 sqlite3.lib。用 VC 编译:


引用
cl /c sqlite3.c //只编译不链接,生成 obj 文件

lib sqlite3.obj




用 GCC 编译的话方法类似
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics