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