Simplify calls to CalcClosestTownFromTile
[openttd/fttd.git] / docs / Readme_Windows_MSVC.txt
blob637b28b2e2972f29c0eab48fc4def006bcd88833
1 Compiling OpenTTD using Microsoft Visual C++
2 Last updated: 2010-01-03
3 --------------------------------------------
4 PLEASE READ THE ENTIRE DOCUMENT BEFORE DOING ANY ACTUAL CHANGES!!
7 SUPPORTED MSVC COMPILERS
8 ------------------------
9 OpenTTD includes projects for MSVC 2005.NET and MSVC 2008.NET. Both will
10 compile out of the box, providing you have the required libraries/headers;
11 which ones, see below. There is no support for VS6 or MSVC 2002, or
12 MSVC 2003.NET. You are therefore strongly encouraged to either upgrade to
13 MSVC 2008 Express (free) or use GCC.
16 1) REQUIRED FILES
17 -----------------
18 You might already have some of the files already installed, so check before
19 downloading; mostly because the DirectX SDK and Platform SDK are about
20 500MB each.
21 Download the following files:
23         * openttd-useful.zip (http://binaries.openttd.org/extra/openttd-useful/)
24         * DirectX 8.1 SDK (http://neuron.tuke.sk/~mizanin/eng/Dx81sdk-include-lib.rar) (or alternatively the latest DirectX SDK from Microsoft)
25         * MS Windows Platform SDK (http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en)
26         * afxres.h (http://www-d0.fnal.gov/d0dist/dist/packages/d0ve/devel/windows/AFXRES.H)
28 ...and of course the newest source from svn://svn.openttd.org/trunk
30 You need an SVN-client to download the source from subversion:
32         * CLI Subversion (http://subversion.tigris.org/)
33         * GUI TortoiseSVN (http://tortoisesvn.tigris.org/)
36 2) INCLUDES AND LIBRARIES
37 -------------------------
38 Put the newly downloaded files in the VC lib\ and include\ directories; where
39 "C:\Program Files\Microsoft Visual Studio 9.0\VC" is your location of Visual C.
40 If you are compiling for an x64 system, use the include\ and lib\ directories
41 from the win64/ folder.
43         * openttd-useful.zip\include\*
44         * afxresh.h
45         to >    C:\Program Files\Microsoft Visual Studio 9.0\VC\Include
47         * openttd-useful.zip\lib\*
48         to >    C:\Program Files\Microsoft Visual Studio 9.0\VC\Lib
50 Custom directories might be recommended, check 2.2)
53 2.1) INCLUDES AND LIBRARIES - DIRECTX/PLATFORM SDK
54 --------------------------------------------------
55 Basically the same procedure as with the useful zip file, providing
56 you are not using the Microsoft installer. Put the include files in the
57 include\ directory and the library files to the Lib\ directory.
59 It is recommended to use custom directories so you don't overwrite any
60 default header or library files.
63 2.2) CUSTOM DIRECTORIES
64 -----------------------
65 If you have put the above include and/or library files into custom folders,
66 MSVC will not find them by default. You need to add these paths to VC through:
68 Tools > Options > Projects and Solutions > VC++ Directories > show directories for
70         * Include files: Add the DirectX/Platform SDK include dir you've created
71         * Library files: Add the path to the SDK custom lib dir
73 NOTE: make sure that the directory for the DirectX SDK is the first one in the
74 list, above all others, otherwise compilation will most likely fail!!
77 3) TTD GRAPHICS FILES
78 ---------------------
79 See section 4.1 of readme.txt for the required 3rdparty files and how to install them.
82 4) COMPILING
83 ------------
84 Open trunk/openttd_vs[89]0.sln
85 Set the build mode to 'Release' in
86 Build > Configuration manager > Active solution configuration > select "Release"
87 Compile...
89 If everything works well the binary should be in trunk/objs/Win[32|64]/Release/openttd.exe
92 5) EDITING, CHANGING SOURCE CODE
93 --------------------------------
94 Set the build mode (back to) 'Debug'
95 Change the startup project to openttd by right-clicking the 'openttd' project
96 in the Solution Explorer and selecting 'Set as Startup Project'. The 'openttd'
97 project should now show up bold instead of 'strgen'.
100 6) PROBLEMS?
101 ------------
102 If compilation fails, double-check that you are using the latest SVN (!)
103 source. If it still doesn't work, check in on IRC (irc://irc.oftc.net/openttd),
104 to ask about reasons; or just wait. The problem will most likely solve itself
105 within a few days as the problem is noticed and fixed.
107 An up-to-date version of this README can be found on the wiki:
108 http://wiki.openttd.org/Microsoft_Visual_C%2B%2B_2008_Express_Editions