微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

利用VS2005编译SQLite3.5.1

1)选择创建一个c++ win32工程;
2)选择win32 project模板;
3)选择工程类型(编译目标类型)为win32 dll。
*如果要创建静态库,则创建一个win32 consoleapplication,并将编译类型选为“static library”。
4)将sqlite3.5.1的所有源码均加入工程。
*注意需要将tclsqlite.c和shell.c、icu.c去掉。其中tclsqlite.c用于生成基于tcl的api,如果要编译,这需要另外下载tcl.h;shell.c用于生成命令行模式的sqlite.exe,如果是静态库形式则可以选择;icu是 internationalcomponents forunicode,如果需要则需另外下载相关头文件
5)选择合适的runtimelibrary,认为多线程模式。位置:project->properties->configurationproperties->c/c++->code generation->runtime library
6)将编译模式改为c模式(tc)。位置:project->properties->configurationproperties->c/c++->advanced->compile as
7)如果想要取得不必要的警告信息,则作如下处理:
-在预处理定义处加 _crt_secure_no_warnings
位置: project->properties->configurationproperties->c/c++->preprocessor->preprocessordeFinitions

- disable制定的警告信息(project->properties->c/c++->advanced->disablespecific warnings): 4267;4244;4018;4311;4996;4312;4311

8)为避免如下警告(以及相关错误

warning c4013:‘tryentercriticalsection’ undefined; assuming extern returningint

在os.h的第72行,#include之前加:

#define _win32_winnt0x0400
#definewin32_lean_and_mean

9)ok,编译,即可成功!

原文地址 http://blog.sina.com.cn/s/blog_41678ec301000bck.html

原文地址:https://www.jb51.cc/sqlite/203209.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐