3 ## Required/optional libraries
5 The following libraries are used by OpenTTD for:
7 - zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
9 - liblzo2: (de)compressing of old (pre 0.3.0) savegames
10 - liblzma: (de)compressing of savegames (1.1.0 and later)
11 - libpng: making screenshots and loading heightmaps
12 - libfreetype: loading generic fonts and rendering them
13 - libfontconfig: searching for fonts, resolving font names to actual fonts
14 - libicu: handling of right-to-left scripts (e.g. Arabic and Persian) and
15 natural sorting of strings (Linux only)
16 - libSDL2: hardware access (video, sound, mouse) (not required for Windows or macOS)
18 OpenTTD does not require any of the libraries to be present, but without
19 liblzma you cannot open most recent savegames and without zlib you cannot
20 open most older savegames or use the content downloading system.
21 Without libSDL/liballegro on non-Windows and non-macOS machines you have
22 no graphical user interface; you would be building a dedicated server.
26 You need Microsoft Visual Studio 2015 Update 3 or newer.
28 You can download the free Visual Studio Community Edition from Microsoft at
29 https://visualstudio.microsoft.com/vs/community/.
31 OpenTTD needs the Platform SDK, if it isn't installed already. This can be
32 done during installing Visual Studio, by selecting
33 `Visual C++ MFC for x86 and x64` (and possibly
34 `Visual C++ ATL for x86 and x64` depending on your version). If not, you
35 can get download it as [MS Windows Platform SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk).
37 Install the SDK by following the instructions as given.
39 Dependencies for OpenTTD on Windows are handled via
40 [vcpkg](https://github.com/Microsoft/vcpkg/). First you need to install vcpkg
41 by following the `Quick Start` instructions of their
42 [README](https://github.com/Microsoft/vcpkg/blob/master/README.md).
44 After this, you can install the dependencies OpenTTD needs. We advise to use
45 the `static` versions, and OpenTTD currently needs the following dependencies:
52 To install both the x64 (64bit) and x86 (32bit) variants (though only one is necessary), you can use:
55 .\vcpkg install liblzma:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static zlib:x64-windows-static
56 .\vcpkg install liblzma:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static zlib:x86-windows-static
59 Open the relevant project file and it should build automatically.
60 - VS 2015: projects/openttd_vs140.sln
61 - VS 2017: projects/openttd_vs141.sln
62 - VS 2019: projects/openttd_vs142.sln
64 Set the build mode to `Release` in
65 `Build > Configuration manager > Active solution configuration`.
68 If everything works well the binary should be in `objs\Win[32|64]\Release\openttd.exe`
69 and in `bin\openttd.exe`
71 The OpenTTD wiki may provide additional help with [compiling for Windows](https://wiki.openttd.org/Compiling_on_Windows_using_Microsoft_Visual_C%2B%2B_2015).
73 You can also build OpenTTD with MSYS2/MinGW-w64 or Cygwin/MinGW using the Makefile. The OpenTTD wiki may provide additional help with [MSYS2](https://wiki.openttd.org/Compiling_on_Windows_using_MSYS2)
75 ## Linux, Unix, Solaris:
77 OpenTTD can be built with GNU '`make`'. On non-GNU systems it is called '`gmake`'.
78 However, for the first build one has to do a '`./configure`' first.
80 The OpenTTD wiki may provide additional help with:
82 - [compiling for Linux and *BSD](https://wiki.openttd.org/Compiling_on_%28GNU/%29Linux_and_*BSD)
83 - [compiling for Solaris](https://wiki.openttd.org/Compiling_on_Solaris)
88 Use '`make`' or Xcode (which will then call make for you)
89 This will give you a binary for your CPU type (PPC/Intel)
90 However, for the first build one has to do a '`./configure`' first.
91 To make a universal binary type '`./configure --enable-universal`'
92 instead of '`./configure`'.
94 The OpenTTD wiki may provide additional help with [compiling for macOS](https://wiki.openttd.org/Compiling_on_Mac_OS_X).
98 Use '`make`', but do a '`./configure`' before the first build.
100 The OpenTTD wiki may provide additional help with [compiling for Haiku](https://wiki.openttd.org/Compiling_on_Haiku).
104 A comprehensive GNU build environment is required to build the OS/2 version.
106 The OpenTTD wiki may provide additional help with [compiling for OS/2](https://wiki.openttd.org/Compiling_on_OS/2).
108 ## Supported compilers
110 The following compilers are tested with and known to compile OpenTTD:
112 - Microsoft Visual C++ (MSVC) 2015, 2017 and 2019.
113 - GNU Compiler Collection (GCC) 4.8 - 9.
116 The following compilers are known not to compile OpenTTD:
118 In general, this is because these old versions do not (fully) support modern
119 C++11 language features.
121 - Microsoft Visual C++ (MSVC) 2013 and earlier.
122 - GNU Compiler Collection (GCC) 4.7 and earlier.
123 - Clang/LLVM 3.8 and earlier.
125 If any of these, or any other, compilers can compile OpenTTD, let us know.
126 Pull requests to support more compilers are welcome.
128 ## Compilation of base sets
130 To recompile the extra graphics needed to play with the original Transport
131 Tycoon Deluxe graphics you need GRFCodec (which includes NFORenum) as well.
132 GRFCodec can be found at https://www.openttd.org/download-grfcodec.
133 The compilation of these extra graphics does generally not happen, unless
134 you remove the graphics file using '`make maintainer-clean`'.
136 Re-compilation of the base sets, thus also use of '`--maintainer-clean`' can
137 leave the repository in a modified state as different grfcodec versions can
138 cause binary differences in the resulting grf. Also translations might have
139 been added for the base sets which are not yet included in the base set
140 information files. Use the configure option '`--without-grfcodec`' to avoid
141 modification of the base set files by the build process.