Page 2 of 2

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

PostPosted: Sun Aug 10, 2014 4:54 pm
by Graf Zahl
That should work, too, but I generally found the 2005 compiler to be more stable.

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

PostPosted: Sat Sep 03, 2016 7:08 pm
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

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

PostPosted: Sat Sep 03, 2016 9:18 pm
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 allExpand view
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. :)

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

PostPosted: Sat Sep 03, 2016 10:43 pm
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.

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

PostPosted: Sun Sep 04, 2016 12:48 am
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.

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

PostPosted: Sun Sep 04, 2016 1:17 am
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 allExpand view

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

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

PostPosted: Sun Sep 04, 2016 1:28 am
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.

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

PostPosted: Sun Sep 04, 2016 2:31 am
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.)

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

PostPosted: Sun Sep 04, 2016 4:33 am
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.

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

PostPosted: Sun Sep 04, 2016 11:25 am
by Blzut3
I suspect this broke the DRDTeam builds:
Code: Select allExpand view
    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.

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

PostPosted: Sun Sep 04, 2016 12:05 pm
by Graf Zahl
Strange. That constant is defined in Xinput.h, which is definitely part of the Windows SDK on my system.

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

PostPosted: Tue Mar 28, 2017 12:19 pm
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