Build and Package Mapnik for windows编译和打包
These are working notes on building Mapnik from source on windows.
- Currently these instructions target the upcoming Mapnik 2.3.x release.
- This is being tested on windows 7 64 bit.
- This is currently only tested with release builds in 32 bit. 64 bit support is planned, but not tested yet.
Visual Studio versions.
These notes attempt to map out the steps to compile Mapnik and dependencies with either VS 2008 or VS 2010. We also plan to support VS 2012.
编译Mapnik和依赖是VS2008或VS2010。
Setup
Step 1: Build Mapnik dependencies
第1步:编译Mapnik依赖
See the building_mapnik_dependencies.md document for details on building Mapnik dependencies.
查看“编译_Mapnik_依赖.md”文档有更多关于编译Mapnik依赖的细节。
Step through it copying and pasting chunks of commands, ensuring they work before continuing.
逐步复制和粘贴命令块,确保它们在继续之前工作。
Step 2: Download and build Mapnik
Currently we are targeting Mapnik 2.3.x:
git clone https://github.com/mapnik/mapnik.git -b 2.3.x mapnik
Next edit the build_mapnik.bat
and ensure the variables match your system (https://github.com/mapnik/mapnik-packaging/blob/18bb66ba95540c069acaf267ea7594bfd83734d9/windows/build_mapnik.bat#L3-L12). In particular ensure that the MAPNIK_SOURCE
variable points the git checkout you just made above.
Then run the build_mapnik.bat
:
cd mapnik-packaging/windows
build_mapnik.bat 1> build.log
Mapnik should be compiled and placed in the folder pointed to by the PREFIX
variable in build_mapnik.bat
If you hit errors you can ask for help by creating an issue at https://github.com/mapnik/mapnik-packaging/issues?state=open
Gochas
The VS 2008 vcbuild
command is broken on arrival
It complains about write-access. To fix it do:
cd C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages
regsvr32 vcprojectengine.dll
https://github.com/mapnik/mapnik-packaging/tree/master/windows
编译依赖
Building Mapnik dependencies on Windows编译Mapnik依赖
(Visual C++ express 2008, 2010 and 2012 32-bit)
Buiding dependencies on windows can be very tedious. The goal here is to provide concise instructions for building individual packages using either VC++ 2008, or 2010/2012.
在windows上构建依赖关系可能非常乏味。这里的目标是提供使用VC++2008或2010/2012构建单个包的简明说明。
Hopefully, this will allow fully automated builds in the future.
希望这将允许将来完全自动化的构建。
Prerequisites前提准备
- Visual C++ 2008, 2010 or 2012, Express or Professional versions