Recently, I've been wanting to get a grasp of the Zandronum source code. I know that Zandronum has many lines of source code spread across many different files, so I understand that trying to comprehend it would be a very long task, especially since I have very little programming experience. In order to try to understand the Zandronum source code better, I decided loading it into an IDE would be very helpful (for debugging/breakpoints, looking up function and object definitions, etc). When following the instructions on the wiki, I came across a couple of obstacles.

Windows Platform SDK
The link provided on the wiki appears to be dead, implying that version 7.0 and earlier of the Windows SDK is no longer available to download. Someone told me they were able to build Zandronum with a more modern version of the Windows SDK; implying that the old version of the Windows SDK linked to on the wiki is mainly for backwards compatibility with Windows XP and maybe even older. Since I personally don't need Zandronum to be backwards compatible, I'm assuming this information is mostly relevant to the developer who builds the official stable and test releases that get uploaded onto the website.

OpenGL Header Files
The wiki says to put the header files into the C:\Program Files\Microsoft SDKs\Windows\v6.1\includes\gl directory. Since I'm using a 64 bit version of Windows, I checked both the Program Files and Program Files (x86) directories, but the gl directory wasn't there. After searching around my hard drive (and a little help from Google), I found my gl directory in C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um. Is this where I should put the OpenGL header files?

Someone told me they were able to build Zandronum with a more modern version of the Windows SDK; implying that the old version of the Windows SDK linked to on the wiki is mainly for backwards compatibility with Windows XP and maybe even older. Since I personally don't need Zandronum to be backwards compatible, I'm assuming this information is mostly relevant to the developer who builds the official stable and test releases that get uploaded onto the website.

I'm still using the old SDK, but newer versions may work. Feel free to try a newer version. If you encounter problems, please post them here. Then we can have a look at the problems together.

The wiki says to put the header files into the C:\Program Files\Microsoft SDKs\Windows\v6.1\includes\gl directory. Since I'm using a 64 bit version of Windows, I checked both the Program Files and Program Files (x86) directories, but the gl directory wasn't there. After searching around my hard drive (and a little help from Google), I found my gl directory in C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um. Is this where I should put the OpenGL header files?

Possibly, depends on which SDK you are using. It shouldn't hurt to put the files there, as long as you don't overwrite anything. If it's not the correct folder for your setup, you'll get a missing include error.

Oh hi Asriel, (him and I were talking about this in #support in the Zandronum discord early this month).

I misspoke the last time I was looking at this, I think I directed Asriel to use the solution file that comes from source control when really the wiki recommends using cmake to generate a new one (sorry about that). When I opened the cmake generated VS solution (and fixed a couple OpenSSL problems on my end) Zand compiled successfully with version 10.0.17763.0 of the Windows SDK.

It looks like _get_pgmptr is returning zero indicating success, but program has a value of "", I'm not sure why this is, tracing the call stack up Zand was started through WinMain so according to the docs it shouldn't do this. Do you guys know why this is happening?

Since I can run a prebuilt Zand 3.0 binary on Windows 7, _get_pgmptr shouldn't be something introduced with Windows 10. Though there may still be something weird going on because "Target Platform" in Project Properties -> General is stuck on "Windows 10".

EDIT: Also, I wasn't able to find a way to select any version of the Windows SDK before 10 in Visual Studio 2017 (15.8.1), even though I have 7.1 installed. Also note that users that download Visual Studio 2017 will also usually get some 10.X version of the Windows SDK. I vaguely remember Visual Studio 2015 was able to select version 7.1 of the Windows SDK but I'm not able to test that at the moment.

Last edited by jwaffe on Sat Oct 20, 2018 6:58 pm, edited 6 times in total.

I thought about it, but ultimately decided not to do it because the wiki said "7.0 or older" and that's technically newer. I should've at least tried, but it seems to build fine using 8.1 and newer except for the Zandronum project.

My best guess is that I probably don't have the OpenGL header files working right. Visual Studio seems to default to version 8.1 of the Windows SDK but I put the OpenGL header files in the folder for version 10.0.17134.0 of the Windows SDK. Maybe if I could change the Windows SDK version for the whole solution instead of for each individual project that could help.

If that doesn't work then maybe C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um\gl isn't the correct folder? If I put the header files in a non-default folder, will I have to specify the directory in CMake?

Something I feel that I should mention is that I'm apparently building a 64-bit version of Zandronum. I noticed that official and development builds of 64-bit Zandronum for Windows don't exist. Can 64-bit Windows versions of Zandronum be built?

Then isn't it odd that there is a 64-bit version of Zandronum for GNU/Linux? Learning x86 assembly has been on my backlog anyway, in the meantime I'll try to build a 32-bit version of Zandronum. Will I need 32-bit versions of the libraries (like FMOD)?

So I downloaded 32-bit versions of all the libraries including python and built a 32-bit version of Zandronum. This would imply it is safe to have 32-bit and 64-bit versions of the libraries and Python coexisting on the same computer. It appears to have built successfully using version 8.1 of the Windows SDK. I've attached my build log for your perusal.

If I wanted to execute the version of Zandronum I built, can I use the debug/start without debugging options in Visual Studio or will I have to run the executable file directly?

You do not have the required permissions to view the files attached to this post.

Then isn't it odd that there is a 64-bit version of Zandronum for GNU/Linux?

Only seemingly so. The Linux version (both 32-bit and 64-bit) simply doesn't use the hqnx asm code at all, since it only works in Win32. One could also exclude this code from the Win64 version to fix the compile problem you encountered, but I never did this since there is no real need for a Win64 version.

When I copied libeay32.dll from the bin folder into the debug folder where zandronum.exe is, and ran Zandronum by doing debug->start debugging, I got the error:

"The application was unable to start correctly (0xc000007b). Click OK to close the application."

On an unrelated note, as cool as learning 64-bit x86 is, would it be more practical if the assembly code was ported to a high level language? While I'm personally more familiar with C, porting it to C++ appears to be more consistent with the rest of the code-base.

On an unrelated note, as cool as learning 64-bit x86 is, would it be more practical if the assembly code was ported to a high level language? While I'm personally more familiar with C, porting it to C++ appears to be more consistent with the rest of the code-base.

There already is a C++ version of this code. The assembler version is just faster, that why it's the default. Our version of the build mechanism is simply missing the proper handling for x64 under Windows. As far as I can tell, the advantages of Win64 over Win32 for Zandronum are negligible. That's why I never spent time on this. What do you hope to gain from Win64 over Win32 for Zandronum?

There already is a C++ version of this code. The assembler version is just faster, that why it's the default. Our version of the build mechanism is simply missing the proper handling for x64 under Windows. As far as I can tell, the advantages of Win64 over Win32 for Zandronum are negligible. That's why I never spent time on this. What do you hope to gain from Win64 over Win32 for Zandronum?

I just thought that an x64 or C/C++ port would've been useful depending on if performance or portability was more important respectively. I appreciate you taking the time to clear this up for me. I guess this is more of an experimental thing that I should do on my own.

Hopefully when I get a better grasp of the code-base I could do something more useful.