Compiling Zandronum with Visual Studio: Difference between revisions

Add instructions for VS 2022
(Add VS 2015 download instructions)
(Add instructions for VS 2022)
Tag: Source edit
Line 3: Line 3:
You will require Visual Studio to compile Zandronum. Officially, Zandronum is built with Visual Studio 2015, but people have had success building it with newer versions.
You will require Visual Studio to compile Zandronum. Officially, Zandronum is built with Visual Studio 2015, but people have had success building it with newer versions.


=== Download Visual Studio 2015 ===
=== Download Visual Studio 2022 ===
Unfortunately, Microsoft has made it somewhat annoying to download VS 2015 legitimately:
Zandronum requires the Visual Studio 2015 toolchain to be built. Microsoft no longer offers 2015 for (easy) download, but forunately, modern versions of Visual Studio can use older toochains.
* Firstly you will need to be signed up to the [https://visualstudio.microsoft.com/dev-essentials/ Visual Studio Dev Essentials] program; this requires a Microsoft account.
 
* Once you logged into your Microsoft account and signed up for Dev Essentials, head to the Downloads page on my.visualstudio.com and search for [https://my.visualstudio.com/Downloads?q=Visual%20Studio%202015 Visual Studio 2015]
<ol>
* Locate and download '''Visual Studio Community 2015 with Update 3'''
<li>Download [https://visualstudio.microsoft.com/downloads/ Visual Studio 2022 Community].</li>
* This download is only available in ISO format; you can mount it as a virtual disc in Windows 8.1 and Windows 10 by opening the ISO with File Explorer.
 
<li>In the installer, select the '''Desktop development with C++''' module.
[[File:Vs2022 cppdevel.png|none]]</li>
 
<li>On the right-hand pane, under the '''Desktop development with C++''' section, select the '''MSVC v140 - VS 2015 C++ build tools (v14.00)''' component.
[[File:Vs2022 v140.png|none]]</li>
 
<li>Proceed with the installation.</li>
</ol>


== CMake ==
== CMake ==
Line 16: Line 24:
http://www.nasm.us/
http://www.nasm.us/


For VC++ 2015, the latest nasm version is required. Currently, this is [http://www.nasm.us/pub/nasm/releasebuilds/2.11.08/nasm-2.11.08.zip Version 2.11.08].
For Visual Studio 2015 or newer, the latest nasm version is required. Currently, this is [http://www.nasm.us/pub/nasm/releasebuilds/2.11.08/nasm-2.11.08.zip Version 2.11.08].


== FMOD Ex ==
== FMOD Ex ==
Line 96: Line 104:
Only available with the keyboard drivers from [http://www.logitech.com/ Logitech] hardware.
Only available with the keyboard drivers from [http://www.logitech.com/ Logitech] hardware.


= Build using Visual Studio 2015 or higher =
= Build using Visual Studio =
== Generate Projects ==
== Generate Projects ==
Open CMake (<code>cmake-gui</code>) and set the ''Where is the source code'' textbox to where you downloaded the Zandronum source code. Set ''Where to build the binaries'' to wherever you want the project files to be generated.
Open CMake (<code>cmake-gui</code>) and set the ''Where is the source code'' textbox to where you downloaded the Zandronum source code. Set ''Where to build the binaries'' to wherever you want the project files to be generated.
Click ''Configure'' and select what you want to generate projects for.
Click ''Configure'' and a dialog will pop up.
 
[[File:Vs2022 cmake.png|thumb]]
 
* Set the generator to '''Visual Studio 17 2022'''.
* Set the platform to '''Win32''' for a 32-bit build or '''x64''' for a 64-bit build.
* Set the toolset to '''v140_xp'''.


If it says there was an error, ignore it as we will solve it now.
If it says there was an error, ignore it as we will solve it now.
Line 133: Line 147:


== error LNK1281: Unable to generate SAFESEH image ==
== error LNK1281: Unable to generate SAFESEH image ==
When using VC++ 2015, update to the latest nasm version.
When using Visual Studio 2015 or newer, update to the latest nasm version.


[[Image:PSVSBuild_Safesehno.png|thumb|right]]
[[Image:PSVSBuild_Safesehno.png|thumb|right]]