3
This is a HowTo guide to help setting up MSVC 2008 (aka VC9) to
7
1. If you haven't already, install MSVC 2008
10
2. Download and install TortoiseSVN if you intend on building from
12
http://tortoisesvn.net/downloads
13
Otherwise skip this step.
16
3. To download the trunk or a branch from the WesnothSVN follow the
18
http://www.wesnoth.org/wiki/SVN_on_Windows
19
Alternatively get the source code from here:
20
http://www.wesnoth.org/wiki/Download
22
For convenience we'll assume that the target folder is:
23
C:\projects\wesnoth\trunk
26
4. In order to prevent extensive manual modifications to the
27
wesnoth.vcproj and wesnothd.vcproj files, we'll set up two
28
'General Folders' for libraries and includes to store most of
29
the prerequisites. (Otherwise each configuration setting for
30
each project would need to have each and every 'lib' and
31
'include' folder added.)
36
5. We'll now start downloading and compiling/copying the
37
prerequisites into the necessary folders:
40
5a. >=zlib-1.2.3 ( http://www.zlib.net/ )
42
Download the zlib source code
44
and unpack it into the projects folder to get:
47
Open the file zlib.dsw in the folder
48
C:\projects\zlib123\projects\visualc6\
49
with MSVC and select 'Yes To All' to convert it into a VC9 project.
51
Open the properties of the 'zlib' solution and in the
52
'Configuration Properties' select the 'DLL Release'
53
'Configuration'. Select 'OK' and then right-click the 'zlib'
54
project and select 'Build'. After a successful Build, close that
58
5b. >=libsdl-1.2.7 ( http://www.libsdl.org )
60
Download the development library file for Win32 as well as the
63
SDL-devel-1.2.13-VC8.zip
64
and unpack them into the projects folder to get:
65
C:\projects\SDL-1.2.13\
67
Copy the 'SDL.dll' and the 'SDL.lib' from the 'lib' folder
68
and the contents of 'include' folder into the corresponding
69
'General Folder' ( ...\_include\ resp. ...\_lib\ ).
71
Unpack the 'VisualC.zip' and open the 'SDL.sln' file with MSVC.
72
Follow the instructions to convert the project to VC9.
74
Right-click the 'SDLmain' project and select 'Build'. After a
75
successful Build, close that instance of MSVC.
77
Copy 'SDLmain.lib' from
78
C:\projects\SDL-1.2.13\VisualC\SDLmain\Debug
79
into the 'lib' 'General Folder'.
82
5c. >=libboost-1.33.0 ( http://www.boost.org/ )
84
Download Boost and unpack it into the folder
87
This should give you a folder structure like
88
C:\projects\boost_1_38_0\
90
Download the pre-built bjam executable
91
boost-jam-3.1.17-1-ntx86.zip
92
from the bjam download page on sourceforge
93
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
94
and unpack and move the bjam executable it into the base folder
96
C:\projects\boost_1_38_0\
98
Now start the command prompt (CMD.exe) and invoke the following
100
C:\> set ZLIB_SOURCE=C:\projects\zlib123\
101
C:\> set ZLIB_LIBPATH=C:\projects\zlib123\projects\visualc6\Win32_DLL_Release
102
C:\> set ZLIB_BINARY=zlib1.dll
103
C:\> cd C:\projects\boost_1_38_0
104
C:\projects\boost_1_38_0> bjam ^
105
More? --toolset=msvc ^
106
More? --build-type=complete ^
107
More? --prefix="C:\projects\Boost\" install
109
Now bjam will compile all variants of the boost library binaries
110
for MSVC 2008 and copies them into the folder
111
C:\projects\Boost\lib\
112
while all required headers are copied into
113
C:\projects\Boost\include\boost-1_38\boost
115
Use the time bjam is busy compiling (possibly several hours) as
116
you wish. (It is possible to continue downloading and copying
117
the include and lib files since all required compiling is done.)
119
Once bjam has finished building/copying, you then can delete
121
C:\projects\boost_1_38_0\
125
5d. >=sdl-image-1.2 (with PNG support)
126
( http://www.libsdl.org/projects/SDL_image )
128
Download the binary file for Win32
129
SDL_image-devel-1.2.7-VC9.zip
130
and unpack it into the projects folder to get:
131
C:\projects\SDL_image-1.2.7\
133
Copy the contents of each the 'lib' and the 'include' folder
134
into the corresponding 'General Folder'.
137
5e. >=sdl-mixer-1.2 (with Vorbis support)
138
( http://www.libsdl.org/projects/SDL_mixer )
140
Download the binary file for Win32
141
SDL_mixer-devel-1.2.8-VC8.zip
142
and unpack it into the projects folder to get:
143
C:\projects\SDL_mixer-1.2.8\
145
Copy the contents of each the 'lib' and the 'include' folder
146
into the corresponding 'General Folder'.
149
5f. >=sdl-net-1.2 ( http://www.libsdl.org/projects/SDL_net )
151
Download the binary file for Win32
152
SDL_net-devel-1.2.7-VC8.zip
153
and unpack it into the projects folder to get:
154
C:\projects\SDL_net-1.2.7\
156
Copy the contents of each the 'lib' and the 'include' folder
157
into the corresponding 'General Folder'.
160
5g. >=sdl-ttf-2.0.8 ( http://www.libsdl.org/projects/SDL_ttf )
162
Download the binary file for Win32
163
SDL_ttf-devel-2.0.9-VC8.zip
164
and unpack it into the projects folder to get:
165
C:\projects\SDL_ttf-2.0.9\
167
Copy the contents of each the 'lib' and the 'include' folder
168
into the corresponding 'General Folder'.
172
( http://gnuwin32.sourceforge.net/packages/gettext.htm )
174
Download the 'Binaries', 'Dependencies' and the
176
gettext-0.14.4-bin.zip
177
gettext-0.14.4-dep.zip
178
gettext-0.14.4-lib.zip
179
and unpack them all into the projects folder to get:
180
C:\projects\gettext-0.14.4\
182
Copy the contents of each the 'lib' and the 'include' folder
183
into the corresponding 'General Folder'.
184
Copy all dll's from the 'bin' folder into the '_lib'
188
5i. >=libfontconfig-2.4.1
189
( http://www.gtk.org/download-windows.html )
191
Download the 'Fontconfig' package 'Binaries' from the
192
'Third Party Dependencies'
193
fontconfig-2.4.2-tml-20071015.zip
194
and unpack it into the projects folder to get:
195
C:\projects\fontconfig-2.4.2\
197
Copy the 'libfontconfig-1.dll' from the 'bin' folder into the
198
'lib' 'General Folder'.
201
5j. >=lua-5.1.4 ( http://luabinaries.luaforge.net/download.html )
203
Download the 'Windows x86 DLL and Includes (Visual C++ 2005
205
lua5_1_4_Win32_dll8_lib.zip
206
and unpack it into the projects folder to get:
207
C:\projects\lua-5.1.4\
209
Copy the dll's and the lib's into the 'lib' 'General Folder' and
210
the content of the 'include' folder into the corresponding '
214
5k. >=pangocairo-1.14.8 ( http://www.gtk.org/download-windows.html )
216
Download the following 'Binaryies' and 'Dev' packages from the
217
'GTK+ individual packages'
218
cairo_1.8.6-1_win32.zip
219
cairo-dev_1.8.6-1_win32.zip
220
glib_2.20.0-1_win32.zip
221
glib-dev_2.20.0-1_win32.zip
222
pango_1.24.0-1_win32.zip
223
pango-dev_1.24.0-1_win32.zip
224
and unpack them into the projects folder to get:
225
C:\projects\pangocairo\
227
Copy all dll's from the 'bin' folder into the '_lib'
229
Copy the contents (but not the subfolders) of the 'lib' folder
230
into the corresponding 'General Folder'.
231
Copy the 'glibconfig.h' file from
232
C:\projects\pangocairo\lib\glib-2.0\include into the '_include'
234
Copy the contens (including subfolders) of the following folders
235
into the '_include' 'General Folder':
236
C:\projects\pangocairo\include\cairo
237
C:\projects\pangocairo\include\glib-2.0
238
C:\projects\pangocairo\include\pango-1.0
241
6. MSVC needs to find all needed includes and libraries, so open
242
Tools --> Options --> Projects and Solutions
245
In the 'Include file' directories add:
247
C:\projects\Boost\include\boost-1_38\
249
In the 'Library files' directories add:
251
C:\projects\Boost\lib\
253
And to be able to launch wesnoth.exe and wesnothd.exe from
254
within MSVC, we'll need to add the 'C:\projects\_lib' folder
255
to windows PATH environment variable:
257
Start the CMD.exe and type in the following command (adjusted
258
to your own folder-structure!) and press enter.
259
C:\> path = %PATH%;C:\projects\_lib
261
Note that it is recommended to restart windows now in order to
262
prevent issues with the compiled executables not finding
266
7. Open the 'wesnoth.sln' file in the
267
C:\projects\wesnoth\trunk\projectfiles\VC9
271
You are now ready to build wesnoth and wesnothd with MSVC.
3
This is a HowTo guide to help setting up MSVC 2008 (aka VC9) to
7
1. If you haven't already, install MSVC 2008
10
2. Download and install TortoiseSVN if you intend on building from
12
http://tortoisesvn.net/downloads
13
Otherwise skip this step.
16
3. To download the trunk or a branch from the WesnothSVN follow the
18
http://www.wesnoth.org/wiki/SVN_on_Windows
19
Alternatively get the source code from here:
20
http://www.wesnoth.org/wiki/Download
22
For convenience we'll assume that the target folder is:
23
C:\projects\wesnoth\trunk
26
4. In order to prevent extensive manual modifications to the
27
wesnoth.vcproj and wesnothd.vcproj files, we'll set up two
28
'General Folders' for libraries and includes to store most of
29
the prerequisites. (Otherwise each configuration setting for
30
each project would need to have each and every 'lib' and
31
'include' folder added.)
36
5. We'll now start downloading and compiling/copying the
37
prerequisites into the necessary folders:
40
5a. >=zlib-1.2.3 ( http://www.zlib.net/ )
42
Download the zlib source code
44
and unpack it into the projects folder to get:
47
Open the file zlib.dsw in the folder
48
C:\projects\zlib123\projects\visualc6\
49
with MSVC and select 'Yes To All' to convert it into a VC9 project.
51
Open the properties of the 'zlib' solution and in the
52
'Configuration Properties' select the 'DLL Release'
53
'Configuration'. Select 'OK' and then right-click the 'zlib'
54
project and select 'Build'. After a successful Build, close that
58
5b. >=libsdl-1.2.7 ( http://www.libsdl.org )
60
Download the development library file for Win32 as well as the
63
SDL-devel-1.2.13-VC8.zip
64
and unpack them into the projects folder to get:
65
C:\projects\SDL-1.2.13\
67
Copy the 'SDL.dll' and the 'SDL.lib' from the 'lib' folder
68
and the contents of 'include' folder into the corresponding
69
'General Folder' ( ...\_include\ resp. ...\_lib\ ).
71
Unpack the 'VisualC.zip' and open the 'SDL.sln' file with MSVC.
72
Follow the instructions to convert the project to VC9.
74
Right-click the 'SDLmain' project and select 'Build'. After a
75
successful Build, close that instance of MSVC.
77
Copy 'SDLmain.lib' from
78
C:\projects\SDL-1.2.13\VisualC\SDLmain\Debug
79
into the 'lib' 'General Folder'.
82
5c. >=libboost-1.33.0 ( http://www.boost.org/ )
84
Download Boost and unpack it into the folder
87
This should give you a folder structure like
88
C:\projects\boost_1_38_0\
90
Download the pre-built bjam executable
91
boost-jam-3.1.17-1-ntx86.zip
92
from the bjam download page on sourceforge
93
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
94
and unpack and move the bjam executable it into the base folder
96
C:\projects\boost_1_38_0\
98
Now start the command prompt (CMD.exe) and invoke the following
100
C:\> set ZLIB_SOURCE=C:\projects\zlib123\
101
C:\> set ZLIB_LIBPATH=C:\projects\zlib123\projects\visualc6\Win32_DLL_Release
102
C:\> set ZLIB_BINARY=zlib1.dll
103
C:\> cd C:\projects\boost_1_38_0
104
C:\projects\boost_1_38_0> bjam ^
105
More? --toolset=msvc ^
106
More? --build-type=complete ^
107
More? --prefix="C:\projects\Boost\" install
109
Now bjam will compile all variants of the boost library binaries
110
for MSVC 2008 and copies them into the folder
111
C:\projects\Boost\lib\
112
while all required headers are copied into
113
C:\projects\Boost\include\boost-1_38\boost
115
Use the time bjam is busy compiling (possibly several hours) as
116
you wish. (It is possible to continue downloading and copying
117
the include and lib files since all required compiling is done.)
119
Once bjam has finished building/copying, you then can delete
121
C:\projects\boost_1_38_0\
125
5d. >=sdl-image-1.2 (with PNG support)
126
( http://www.libsdl.org/projects/SDL_image )
128
Download the binary file for Win32
129
SDL_image-devel-1.2.7-VC9.zip
130
and unpack it into the projects folder to get:
131
C:\projects\SDL_image-1.2.7\
133
Copy the contents of each the 'lib' and the 'include' folder
134
into the corresponding 'General Folder'.
137
5e. >=sdl-mixer-1.2 (with Vorbis support)
138
( http://www.libsdl.org/projects/SDL_mixer )
140
Download the binary file for Win32
141
SDL_mixer-devel-1.2.8-VC8.zip
142
and unpack it into the projects folder to get:
143
C:\projects\SDL_mixer-1.2.8\
145
Copy the contents of each the 'lib' and the 'include' folder
146
into the corresponding 'General Folder'.
149
5f. >=sdl-net-1.2 ( http://www.libsdl.org/projects/SDL_net )
151
Download the binary file for Win32
152
SDL_net-devel-1.2.7-VC8.zip
153
and unpack it into the projects folder to get:
154
C:\projects\SDL_net-1.2.7\
156
Copy the contents of each the 'lib' and the 'include' folder
157
into the corresponding 'General Folder'.
160
5g. >=sdl-ttf-2.0.8 ( http://www.libsdl.org/projects/SDL_ttf )
162
Download the binary file for Win32
163
SDL_ttf-devel-2.0.9-VC8.zip
164
and unpack it into the projects folder to get:
165
C:\projects\SDL_ttf-2.0.9\
167
Copy the contents of each the 'lib' and the 'include' folder
168
into the corresponding 'General Folder'.
172
( http://gnuwin32.sourceforge.net/packages/gettext.htm )
174
Download the 'Binaries', 'Dependencies' and the
176
gettext-0.14.4-bin.zip
177
gettext-0.14.4-dep.zip
178
gettext-0.14.4-lib.zip
179
and unpack them all into the projects folder to get:
180
C:\projects\gettext-0.14.4\
182
Copy the contents of each the 'lib' and the 'include' folder
183
into the corresponding 'General Folder'.
184
Copy all dll's from the 'bin' folder into the '_lib'
188
5i. >=libfontconfig-2.4.1
189
( http://www.gtk.org/download-windows.html )
191
Download the 'Fontconfig' package 'Binaries' from the
192
'Third Party Dependencies'
193
fontconfig-2.4.2-tml-20071015.zip
194
and unpack it into the projects folder to get:
195
C:\projects\fontconfig-2.4.2\
197
Copy the 'libfontconfig-1.dll' from the 'bin' folder into the
198
'lib' 'General Folder'.
201
5j. >=lua-5.1.4 ( http://luabinaries.luaforge.net/download.html )
203
Download the 'Windows x86 DLL and Includes (Visual C++ 2005
205
lua5_1_4_Win32_dll8_lib.zip
206
and unpack it into the projects folder to get:
207
C:\projects\lua-5.1.4\
209
Copy the dll's and the lib's into the 'lib' 'General Folder' and
210
the content of the 'include' folder into the corresponding '
214
5k. >=pangocairo-1.14.8 ( http://www.gtk.org/download-windows.html )
216
Download the following 'Binaryies' and 'Dev' packages from the
217
'GTK+ individual packages'
218
cairo_1.8.6-1_win32.zip
219
cairo-dev_1.8.6-1_win32.zip
220
glib_2.20.0-1_win32.zip
221
glib-dev_2.20.0-1_win32.zip
222
pango_1.24.0-1_win32.zip
223
pango-dev_1.24.0-1_win32.zip
224
and unpack them into the projects folder to get:
225
C:\projects\pangocairo\
227
Copy all dll's from the 'bin' folder into the '_lib'
229
Copy the contents (but not the subfolders) of the 'lib' folder
230
into the corresponding 'General Folder'.
231
Copy the 'glibconfig.h' file from
232
C:\projects\pangocairo\lib\glib-2.0\include into the '_include'
234
Copy the contens (including subfolders) of the following folders
235
into the '_include' 'General Folder':
236
C:\projects\pangocairo\include\cairo
237
C:\projects\pangocairo\include\glib-2.0
238
C:\projects\pangocairo\include\pango-1.0
241
6. MSVC needs to find all needed includes and libraries, so open
242
Tools --> Options --> Projects and Solutions
245
In the 'Include file' directories add:
247
C:\projects\Boost\include\boost-1_38\
249
In the 'Library files' directories add:
251
C:\projects\Boost\lib\
253
And to be able to launch wesnoth.exe and wesnothd.exe from
254
within MSVC, we'll need to add the 'C:\projects\_lib' folder
255
to windows PATH environment variable:
257
Start the CMD.exe and type in the following command (adjusted
258
to your own folder-structure!) and press enter.
259
C:\> path = %PATH%;C:\projects\_lib
261
Note that it is recommended to restart windows now in order to
262
prevent issues with the compiled executables not finding
266
7. Open the 'wesnoth.sln' file in the
267
C:\projects\wesnoth\trunk\projectfiles\VC9
271
You are now ready to build wesnoth and wesnothd with MSVC.