Windows下SQLite自动下载并编译(含dll和exe)
好久没有光顾sqlite了,没想到已经到了3.7.8了。
以前手动下载,并且建工程,编译,挺浪费时间的。干脆用wget, 7z, 结合批处理,整理成一个可以下载并编译成dll和exe的脚本。至于wget, 7z,网上都可以直接下载,不再缀述。
运行脚本之前,请先将vs2008(或者vs2005,vs2003,甚至vc6)的vcvars32.bat运行一下,得到vc的编译环境。
内容如下:
- @echo off
- set version=%1
- set os_cpu=win32-x86
- rem
- rem from sqlite3.7.4,
- rem sqlite3-product-version.zip
- rem sqlite3-product-version.tar.gz
- rem sqlite3-product-os-cpu-version.zip
- rem sqlite3-product-date.zip
- @rem sqlite-build 3070500 3070400 3070800
- if not exist "sqlite-amalgamation-%version%.zip" (
- echo fetching sqlite-amalgamation-%version%.zip ...
- wget http://www.sqlite.org/sqlite-amalgamation-%version%.zip
- if not exist "sqlite-amalgamation-%version%.zip" (
- echo download sqlite-amalgamation-%version%.zip error!
- goto EOF
- )
- )
- 7z x -y -o.\sqlite-amalgamation-%version% "sqlite-amalgamation-%version%.zip"
- if exist ".\sqlite-amalgamation-%version%\sqlite-amalgamation-%version%" (
- move .\sqlite-amalgamation-%version%\sqlite-amalgamation-%version%\* .\sqlite-amalgamation-%version%\
- )
- if not exist ".\sqlite-amalgamation-%version%\shell.c" (
- echo copy shell.c from another location ...
- if not exist ".\sqlite-source-%version%.zip" (
- echo fetching sqlite-source-%version%.zip ...
- wget http://www.sqlite.org/sqlite-source-%version%.zip
- )
- 7z x -y -o.\sqlite-source-%version% "sqlite-source-%version%.zip"
- copy /y .\sqlite-source-%version%\shell.c .\sqlite-amalgamation-%version%\
- rd /s /q sqlite-source-%version%
- echo copy shell.c from another location ...
- if not exist ".\sqlite-src-%version%.zip" (
- echo fetching sqlite-src-%version%.zip ...
- wget http://www.sqlite.org/sqlite-src-%version%.zip
- )
- 7z x -y -o.\ "sqlite-src-%version%.zip"
- copy /y .\sqlite-src-%version%\shell.c .\sqlite-amalgamation-%version%\
- rd /s /q sqlite-src-%version%
- )
- if not exist ".\sqlite-amalgamation-%version%\sqlite3.def" (
- if not exist "sqlitedll-%version%.zip" (
- echo fetching sqlitedll-%version%.zip ...
- wget http://www.sqlite.org/sqlitedll-%version%.zip
- )
- 7z x -y -o.\sqlitedll-%version% "sqlitedll-%version%.zip"
- copy /y .\sqlitedll-%version%\sqlite3.def .\sqlite-amalgamation-%version%\
- rd /s /q sqlitedll-%version%
- echo try another dll zip
- if not exist "sqlite-dll-%os_cpu%-%version%.zip" (
- echo fetching sqlite-dll-%os_cpu%-%version%.zip ...
- wget http://www.sqlite.org/sqlite-dll-%os_cpu%-%version%.zip
- )
- 7z x -y -o.\sqlite-dll-%os_cpu%-%version% "sqlite-dll-%os_cpu%-%version%.zip"
- copy /y .\sqlite-dll-%os_cpu%-%version%\sqlite3.def .\sqlite-amalgamation-%version%\
- rd /s /q sqlite-dll-%os_cpu%-%version%
- )
- cd /d sqlite-amalgamation-%version%
- echo begin building sqlite-amalgamation-%version%
- cl -Gs -GX -D_WIN32 -nologo -Zi -DOS_WIN=1 -DSQLITE_DEBUG=1 -DWIN32=1 -DTHREADSAFE=1 -DSQLITE_OS_WIN=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SOUNDEX=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -I. shell.c sqlite3.c -o sqlite3.exe
- echo sqlite3.exe build finished ......
- cl /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SQLITE3_EXPORTS" /D THREADSAFE=1 /D SQLITE_OS_WIN=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_SOUNDEX=1 /D QLITE_OMIT_LOAD_EXTENSION=1 /D SQLITE_ENABLE_RTREE=1 /YX /Fp"sqlite3.pch" /FD /GZ /c /debug sqlite3.c
- rem lib -out:"sqlite3.lib" sqlite3.obj
- link.exe kernel32.lib user32.lib /nologo /dll /incremental:yes /debug /machine:I386 /pdb:"sqlite3.pdb" /def:"sqlite3.def" /out:"sqlite3.dll" /implib:"sqlite3.lib" /pdbtype:sept sqlite3.obj
- echo sqlite3.dll build finished ......
- echo end building sqlite-amalgamation-%version%
- echo -----------------------------------------------
- cd /d ..
- :EOF
- @echo on
以下是我的执行结果:
--2011-09-20 08:48:30-- http://www.sqlite.org/sqlite-amalgamation-3070800.zip
Resolving www.sqlite.org... 67.18.92.124
Connecting to www.sqlite.org|67.18.92.124|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1329197 (1.3M) [application/zip]
Saving to: `sqlite-amalgamation-3070800.zip'
100%[==========================================================>] 1,329,197 119K/s in 11s
2011-09-20 08:48:41 (120 KB/s) - `sqlite-amalgamation-3070800.zip' saved [1329197/1329197]
7-Zip 9.15 beta Copyright (c) 1999-2010 Igor Pavlov 2010-06-20
Processing archive: sqlite-amalgamation-3070800.zip
Extracting sqlite-amalgamation-3070800
Extracting sqlite-amalgamation-3070800\shell.c
Extracting sqlite-amalgamation-3070800\sqlite3.c
Extracting sqlite-amalgamation-3070800\sqlite3.h
Extracting sqlite-amalgamation-3070800\sqlite3ext.h
Everything is Ok
Folders: 1
Files: 4
Size: 5059684
Compressed: 1329197
E:\xionghe\sqlite\sqlite-3.7.3\demo\sqlite-amalgamation-3070800\sqlite-amalgamation-3070800\shell.c
E:\xionghe\sqlite\sqlite-3.7.3\demo\sqlite-amalgamation-3070800\sqlite-amalgamation-3070800\sqlite3.c
E:\xionghe\sqlite\sqlite-3.7.3\demo\sqlite-amalgamation-3070800\sqlite-amalgamation-3070800\sqlite3.h
E:\xionghe\sqlite\sqlite-3.7.3\demo\sqlite-amalgamation-3070800\sqlite-amalgamation-3070800\sqlite3ext.h
fetching sqlitedll-3070800.zip ...
--2011-09-20 08:48:46-- http://www.sqlite.org/sqlitedll-3070800.zip
Resolving www.sqlite.org... 67.18.92.124
Connecting to www.sqlite.org|67.18.92.124|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2011-09-20 08:48:47 ERROR 404: Not Found.
7-Zip 9.15 beta Copyright (c) 1999-2010 Igor Pavlov 2010-06-20
Error:
cannot find archive
The system cannot find the path specified.
The system cannot find the file specified.
try another dll zip
fetching sqlite-dll-win32-x86-3070800.zip ...
--2011-09-20 08:48:47-- http://www.sqlite.org/sqlite-dll-win32-x86-3070800.zip
Resolving www.sqlite.org... 67.18.92.124
Connecting to www.sqlite.org|67.18.92.124|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 289182 (282K) [application/zip]
Saving to: `sqlite-dll-win32-x86-3070800.zip'
100%[==========================================================>] 289,182 127K/s in 2.2s
2011-09-20 08:48:51 (127 KB/s) - `sqlite-dll-win32-x86-3070800.zip' saved [289182/289182]
7-Zip 9.15 beta Copyright (c) 1999-2010 Igor Pavlov 2010-06-20
Processing archive: sqlite-dll-win32-x86-3070800.zip
Extracting sqlite3.def
Extracting sqlite3.dll
Everything is Ok
Files: 2
Size: 575107
Compressed: 289182
1 file(s) copied.
begin building sqlite-amalgamation-3070800
cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
shell.c
sqlite3.c
Generating Code...
sqlite3.exe build finished ......
cl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
cl : Command line warning D9035 : option 'GZ' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'RTC1' instead of 'GZ'
cl : Command line warning D9002 : ignoring unknown option '/MLd'
cl : Command line warning D9002 : ignoring unknown option '/YX'
cl : Command line warning D9002 : ignoring unknown option '/debug'
sqlite3.c
LINK : warning LNK4044: unrecognized option '/pdbtype:sept'; ignored
LINK : sqlite3.dll not found or not built by the last incremental link; performing full link
Creating library sqlite3.lib and object sqlite3.exp
sqlite3.dll build finished ......
end building sqlite-amalgamation-3070800
-----------------------------------------------
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
Windows下SQLite自动下载并编译(含dll和exe)相关推荐
- windows下gdb的下载和安装使用初步
GDB,UNIX及UNIX-like下的调试工具.Linux下的调试工具. 据说可以在Windows下使用gdb: 步骤有二: 1 安装MinGW:可参阅, https://blog.csdn.net ...
- mac 下设置自动下载必应壁纸
mac 下设置自动下载必应壁纸 mac 下自动更换壁纸 设置自动下载必应壁纸 问题 mac 下自动更换壁纸 设置自动下载必应壁纸 mac 下定时任务创建 mac 下定时任务可以利用launchctl, ...
- 一个Android下的自动下载歌词的代码
一个Android下的自动下载歌词的代码 http://blog.csdn.net/nanjingjiangbiao/article/details/6096376
- windows下定时自动打开某网页并在访问结束后自动关闭浏览器
2019独角兽企业重金招聘Python工程师标准>>> 思路:使用windows下的bat脚本文件执行"打开网址->等待->关闭浏览器"的操作:使用w ...
- windows下maven3.6下载安装配置
windows下maven3.6下载安装配置 一.下载 二.环境配置 三. Maven 本地仓库的配置 四.idea配置maven 一.下载 下载地址: 链接:https://pan.baidu.co ...
- Windows下SQL Server下载安装
Windows下SQL Server下载安装: 1.首先我们从学习通里面找到SQL Server2019下载地址(进入下载官网的途径,当然但是我们可以选择下载2022版本),打开该文件,复制该地址,并 ...
- Frambuffer_rd在Windows下的vivado 2020.1编译报错解决方法
vivado2020.1 HLS生成的IP在Windows下报错 Frambuffer_rd在Windows下的vivado 2020.1编译报错解决方法 我的解决方法: 编译过程如下 之后重新对工程 ...
- 如果Windows下Quick软件运行时显示无权限打开exe
如果Windows下Quick软件运行时显示无权限打开exe, 问题在于你的windows进程里已经存在此软件的exe进程了,需要将其杀死,才可以再次运行此软件
- 适用于树莓派Raspberry Pi的嵌入式QT平台(二) -- 在Windows下用Qt Creator开发编译Raspberry Qt 5应用程序...
接着上篇 "交叉编译安装Qt Embedded 5.5",我们已经成功在Windows上交叉编译了Raspberry Pi的嵌入式Qt 5.5.那么我们就可以开始开发基于Qt 5的 ...
最新文章
- 题目:查找数组中的重复数字,要求空间复杂度为O(1)(基于Java实现)
- 不用鼠标,只用键盘,你还能操作自如吗?
- 删除目录下指定文件中匹配行
- 深度学习中学习率(lr:learn rate)和batchsize如何影响模型性能?
- 搭建集群时的问题总结
- 今日头条核心技术“个性推荐算法”揭秘
- 自适应 幻灯片代码 app_字节跳动 To B 再添一员,将推出飞书文档独立App | 36氪独家...
- mysql 高版本检索外键_第05期:外键到底能不能用?
- Ajax请求中async属性
- Win10 Word背景默认是绿色的怎么取消?
- 【微信公众号-订阅号发送群发消息】
- 抖音挑战微信能赢么?
- JavaScript 获取当前周数
- 网页版番茄时钟的制作——Pomodoro Clock
- VIVO NEX 3 5G版上手评测,除99.6%的屏占比,还有什么理由入手
- 95后程序员月薪2万带着电脑送外卖 不想35岁就被社会淘汰 你呢
- mac上metersphere本地开发环境搭建
- 用Tina-TI软件仿真并分析RC积分电路和微分电路
- Docker启动了Mysql命令行连不上报access denied for user ‘sy-fjj-web‘@‘localhost‘ (using password: YES)
- 尼采——什么才是真正的爱?
热门文章
- mysql 日期语句to_days
- AssertionError: Duplicate registrations for type ‘experimentalOptimizer‘解决方案
- springboot整合openApi
- UVA 10838 (alpha-bate剪枝搜索)
- 2017-2018 ACM-ICPC Asia East Continent League Final L. SOS(博弈,思维)
- 前端学习总结(四)jQuery
- python人才缺口_月薪3W,人才缺口高达19W,大牛带你9周掌握Python和数据分析!
- 1995年考研数学一真题pdf
- AndroidStudio-图片的上传以及存进mysql数据库里
- 国科大学习资料--图像处理(彭思龙、杨戈)--2019年期末考试题解析(学长整理分析)