[Tutorial] Compiling the GZDoom source code with CMake
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Tutorial] Compiling the GZDoom source code with CMake
That should work, too, but I generally found the 2005 compiler to be more stable.
Re: [Tutorial] Compiling the GZDoom source code with CMake
Is this tutorial still up to date? It seems to me that is not. The Wiki page http://zdoom.org/wiki/Compile_ZDoom_on_Windows for zdoom states "Visual Studio 2015 is only required for the development versions of ZDoom" . I assume the same is true about compiling development versions of GZDoom. I have just set up everything according to this tutorial (I think) and used VC++2010 express and got a lot of syntax errors (see attached file).
Re: [Tutorial] Compiling the GZDoom source code with CMake
The required downloads for Visual C++ 2015 are wrong at least.
There is no need to download the old DirectX SDK, and I don't think there's a need to download the Windows SDK either. In both cases what is bundled with Visual Studio should be enough. For example, my cmake vars are configured as follows:
I don't think I ever downloaded the Windows 10 SDK, although I'm not 100% sure. One thing is for certain, the DirectX SDK has been merged into the Windows SDK since June 2010.
There is no need to download the old DirectX SDK, and I don't think there's a need to download the Windows SDK either. In both cases what is bundled with Visual Studio should be enough. For example, my cmake vars are configured as follows:
Code: Select all
D3D_INCLUDE_DIR = C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/um
DX_dinput8_LIBRARY = C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10586.0/um/x86/dinput8.lib
DX_dxguid_LIBRARY = C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10586.0/um/x86/dxguid.lib
XINPUT_INCLUDE_DIR = C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/um
Re: [Tutorial] Compiling the GZDoom source code with CMake
You need to use Visual Studio 2015, any previous version won't build (G)ZDoom.drako wrote:Is this tutorial still up to date? It seems to me that is not. The Wiki page http://zdoom.org/wiki/Compile_ZDoom_on_Windows for zdoom states "Visual Studio 2015 is only required for the development versions of ZDoom" . I assume the same is true about compiling development versions of GZDoom. I have just set up everything according to this tutorial (I think) and used VC++2010 express and got a lot of syntax errors (see attached file).
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Tutorial] Compiling the GZDoom source code with CMake
Since GZDoom is a superset of ZDoom, any limitation in compiler environment obviously applies to both. Yes, VS 2015 is REQUIRED. ZDoom's code is C++11, which VS 2010 does not support, and VS 2012 and VS2013 only support partially, both are lacking features required by ZDoom.drako wrote:Is this tutorial still up to date? It seems to me that is not. The Wiki page http://zdoom.org/wiki/Compile_ZDoom_on_Windows for zdoom states "Visual Studio 2015 is only required for the development versions of ZDoom" . I assume the same is true about compiling development versions of GZDoom. I have just set up everything according to this tutorial (I think) and used VC++2010 express and got a lot of syntax errors (see attached file).
@dpJudas: Interesting info about the DirectX SDK. The question now should be, do we even need the setup variables here or is this directory among the default settings for the compiler and can be removed from CMake? Unfortunately I do not know how to look what those compiler variables like $(WindowsSDK_IncludePath) actually contain.
Re: [Tutorial] Compiling the GZDoom source code with CMake
They are part of the default include/library paths in Visual Studio 2015. I just tried creating a completely new fresh Win32 project with this program:Graf Zahl wrote:@dpJudas: Interesting info about the DirectX SDK. The question now should be, do we even need the setup variables here or is this directory among the default settings for the compiler and can be removed from CMake? Unfortunately I do not know how to look what those compiler variables like $(WindowsSDK_IncludePath) actually contain.
Code: Select all
#include <Windows.h>
#include <Xinput.h>
#include <d3d9.h>
#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "xinput.lib")
#pragma comment(lib, "d3d9.lib")
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
Direct3DCreate9(D3D_SDK_VERSION);
return 0;
}
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Tutorial] Compiling the GZDoom source code with CMake
Ok. I'll try to do a setup with these options removed from CMakeLists later. Would be nice if this could simplify the setup.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Tutorial] Compiling the GZDoom source code with CMake
Tested it and it worked out of the box. I removed the options for Visual Studio, they only remain for MinGW, although that's still not working for other reasons (and probably never will unless someone willing to bother with it fixes it.)
Re: [Tutorial] Compiling the GZDoom source code with CMake
You might want to get a Windows7 user to test a Xbox controller. The Windows SDK only links to the Win8/10 Xinput14 or gimped Xinput91 (unless Zdoom reports battery life for wireless controlers don't think it affects anything). IIRC Zdoom is defining WIN32_WINNT as XP before including Xinput.h so it should be linking against the latter.
-
-
- Posts: 3144
- Joined: Wed Nov 24, 2004 12:59 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: [Tutorial] Compiling the GZDoom source code with CMake
I suspect this broke the DRDTeam builds:
Can't change anything on it until the 12th as I'm away from home.
Code: Select all
34>C:\Build\GZDoom\GZDoom-devel\src\win32\i_xinput.cpp(126): error C2065: 'XUSER_MAX_COUNT': undeclared identifier [C:\Build\GZDoom\GZDoom-devel\build\src\zdoom.vcxproj]
34>C:\Build\GZDoom\GZDoom-devel\src\win32\i_xinput.cpp(632): error C2065: 'XUSER_MAX_COUNT': undeclared identifier [C:\Build\GZDoom\GZDoom-devel\build\src\zdoom.vcxproj]
34>C:\Build\GZDoom\GZDoom-devel\src\win32\i_xinput.cpp(646): error C2065: 'XUSER_MAX_COUNT': undeclared identifier [C:\Build\GZDoom\GZDoom-devel\build\src\zdoom.vcxproj]
34>C:\Build\GZDoom\GZDoom-devel\src\win32\i_xinput.cpp(680): error C2065: 'XUSER_MAX_COUNT': undeclared identifier [C:\Build\GZDoom\GZDoom-devel\build\src\zdoom.vcxproj]
34>C:\Build\GZDoom\GZDoom-devel\src\win32\i_xinput.cpp(696): error C2065: 'XUSER_MAX_COUNT': undeclared identifier [C:\Build\GZDoom\GZDoom-devel\build\src\zdoom.vcxproj]
34>C:\Build\GZDoom\GZDoom-devel\src\win32\i_xinput.cpp(716): error C2065: 'XUSER_MAX_COUNT': undeclared identifier [C:\Build\GZDoom\GZDoom-devel\build\src\zdoom.vcxproj]
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Tutorial] Compiling the GZDoom source code with CMake
Strange. That constant is defined in Xinput.h, which is definitely part of the Windows SDK on my system.
-
- Posts: 1
- Joined: Tue Mar 28, 2017 12:06 pm
Re: [Tutorial] Compiling the GZDoom source code with CMake
I can't find
__MACHINEI(unsigned char _interlockedbittestandset(long volatile *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long volatile *a, long b))
in intrin.h
__MACHINEI(unsigned char _interlockedbittestandset(long volatile *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long volatile *a, long b))
in intrin.h