Installing MSYS2 on windows
1.Download msys2 to your computer. http://www.msys2.org
There you can downlaod the programm. There ir a 32bit version and 64bit version choose the one you want to install. Both version can create 32bit and 64bit programms.
2. The programm do not like space in the name of installation. So better just use the default C:\msys64 (i install the 64bit version)
3. After the installation finish you will notice that in your start menu > programms there is a new option called msys2 64bit
there you have 3 options
msys2 MinGW 32 bit (use it to make 32 bit programms)
msys2 MinGW 64 bit (use it to make 64 bit programms)
Depending your target, use the MinGw either the 32bit or the 64bit. It is recomended not to use the msys.
4. MinGW as all compillers needs Libraries to create a programm. Different programms will need different libraries. So you need to install some libraries.
But first some commands to use with MinGW
pacboy -S name
will promp you to install the library name both 32 bit and 64 bit
pacboy -S name:x
will promp you to install the library name only 64 bit version
pacboy -S name:inwill promp you to install the library name only 32 bit version
So depending if you want to make 32 bit or 64 bit or both download the apropriate choice
packboy -R name
will unistall the name
will upadate the msys2 installation if update is available
will update the libraries you have isntall to the newer version if any
pacboy -S toolchain
will prompt you to install a collection of libraries most commonly used
there is also the command
pacman -S name
which will promp you to install the library name
the difference is that pacboy will download libraries best suited for MinGW so it is recomended to get those. But if you can not find a specific library custom made for MinGW use pacman to download and use that one.
5. Installing libraries
packboy -S toolchain
install everything except option 4 and 5 you will not need it for ottd or if you want install all.
pacboy -S lzo2
pacboy -S libpng
packboy -S icu
If you want your programm to have support for non latin languages.
pacman -S make
6. Get the source files of OTTD. https://github.com/OpenTTD/OpenTTD
Is the location where you can find the source files.
7. Run MinGW and go to the location you have the source files. type
this runs a file that check if your compiler have the necesery libraries to create OTTD. Since OTTD is multi platform some libraries are for other OS and you will not need them.
if you get an error lzo2 not found is because the OTTD is looking for the lzo2 in the wrong place.https://github.com/glx22/OpenTTD/commit ... df0c7557eb
there is a newer version of the config.lib file that tells where the lzo2 is install in msys2. The current config.lib has setting for msys which has a slight different folder structure.
8. Now you are ready to compile (create the programm) type
while you have the MinGW in the OTTD source file location. It will take a while to finish. When finish there is a folder called BIN there you will find the programm you created. You can run it from there to test it.
you can use this to update the wiki