[Tutorial] Compiling the GZDoom source code with CMake

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by Graf Zahl »

That should work, too, but I generally found the 2005 compiler to be more stable.
drako
Posts: 30
Joined: Fri Jan 08, 2016 8:16 pm

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by drako »

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).
vs10errors.txt
(50.86 KiB) Downloaded 71 times
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by dpJudas »

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:

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
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. :)
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by _mental_ »

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).
vs10errors.txt
You need to use Visual Studio 2015, any previous version won't build (G)ZDoom.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by Graf Zahl »

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).
vs10errors.txt
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.

@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.
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by dpJudas »

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.
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:

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;
}
Compiles and links here with no further changes needed. I'm not sure if CMake automatically uses the default search paths or not - my knowledge of CMake is almost non-existent I'm afraid.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by Graf Zahl »

Ok. I'll try to do a setup with these options removed from CMakeLists later. Would be nice if this could simplify the setup.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by Graf Zahl »

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.)
User avatar
DaMan
Posts: 727
Joined: Fri Jan 01, 2010 7:14 am

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by DaMan »

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.
Blzut3
 
 
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

Post by Blzut3 »

I suspect this broke the DRDTeam builds:

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]
Can't change anything on it until the 12th as I'm away from home.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by Graf Zahl »

Strange. That constant is defined in Xinput.h, which is definitely part of the Windows SDK on my system.
Greggory Lee
Posts: 1
Joined: Tue Mar 28, 2017 12:06 pm

Re: [Tutorial] Compiling the GZDoom source code with CMake

Post by Greggory Lee »

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
Post Reply

Return to “General”