Building a Windows Version of Alpine
By now, anyone with access to a computer running the Windows operative
system can compile the windows version of Alpine. These directions were
tested in a computer running Windows 7, and explains how to build
PC-Alpine using different versions of Visual Studio. I would like to thank
Stéphane Larouche for sending these directions. Some time
ago I wrote a different set of directions.
The directions sent by Larouche are simpler.
In order to build Alpine, you will need
- A compiler. This is something you do only once for the rest of your
life, unless for any reason you need to update it. In this exposition
we will concentrate on Visual C++ Express, which is a free program
you can download. You can obtain Visual Studio 2013 Express from
- The source code of Alpine, which you can get from http://alpine.x10host.com/alpine/release/.
- a program to decompress the source code of Alpine.
- Modify build.bat:
- In line 45: add "-DWINVER=0x0601" to extracflagsnq
("set extracflagsnq=-DWINVER=0x0601 /Zi -Od ...")
- Open VS2013 x86 Native Tools Command Prompt:
- Using the Start Menu, start Visual Studio Tools;
Click on VS2013 x86 Native Tools Command Prompt.
- In the VS2013 x86 Native Tools Command Prompt, navigate to the alpine
source code directory.
- Execute "build wnt"
- Visual Studio Express installs a Windows SDK. There is no need to
install another one.
- The Visual Studio Command Prompt automatically sets environment
variables to the correct include and lib paths.
- Without modifying build.bat, a compiling error occurs.
- Alpine also compiles using Visual Studio Express 2008, 2010, and
2012 (for 2008 and 2010 don't forget to apply the SP1 or a linking error
- Alpine does not compile using Visual Studio 2015 because of a change
in the implementation of the FILE type (see struct _iobuf in stdio.h) that
now hides members. This affects yunchan.c which depends on the old
implementation. (This is being investigated. There seems to be another problem
that time.h does not define tzname nor daylight, so we need to investigate that.)