Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1299749
  • 博文数量: 436
  • 博客积分: 7854
  • 博客等级: 少将
  • 技术积分: 3225
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-18 16:30
文章分类

全部博文(436)

文章存档

2013年(2)

2012年(56)

2011年(70)

2010年(308)

分类:

2010-07-21 14:58:20

SQLite 官方提供的编译方法:



引用
MSVC and SQLite DLL
Creation of an import library from the 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 编译的话方法类似
阅读(396) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~