Compiling Glquake on windows7

Discuss programming topics for the various GPL'd game engine sources.
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Compiling Glquake on windows7

Post by Charlieguitar »

Hi there, i've recently gotten into quake engine editing and im wondering if anyone has a guide on how to compile glquake on windows7 so that it launches without error or having to run in compatability modes. I've had no luck so far and im somewhat new to visual studio 2008 and how to add the new libraries and headers that i assume is needed to make it run on win7. I've looked at Fritzquake and while that compiles and works fine, i'd rather start off with the standard 1.6 sourcecode than use someone elses modified version (for now)
Any help would be greatly aprecciated, thank you :]
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

This should be straightforward; I've done it loads of times. There are quite a few steps involved, particularly with the assembly language stuff (if you want to keep it) though, so could you indicate where you're running into trouble and let's see if we can get you moving on from there. :D
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Post by Charlieguitar »

Well i guess my main problem is that im not familiar with MSVC2008 but i figured its the best way to go. I can get it up and running and compile the source fine. Im just not sure exactly what headers and libraries i need to update to make glquake run on windows7. Or indeed where to find them, any pointer in that direction would definetly be a great help! I feel incredibly dumb right now :p
metlslime
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Post by metlslime »

Well, it's not completely straightforward. You need to build gas2masm first, then maybe copy it to a different folder, then download and install ml.exe, then build the main project (which uses gas2masm to convert .s files and then runs ml.exe to actually build them)

Other than that, the header files are all included in the source release (mainly directx files) so that part should work...

Oh, and there may be an issue with the ERRNO variable colliding with the name of a macro. And Afxres.h is not present on newer installs of MSVC, i think...
Lardarse
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Post by Lardarse »

Doesn't Baker's re-release of the GLQuake source code have all of the hassle dealt with, so that it should just compile?
Roaming status: Testing and documentation
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Post by Charlieguitar »

could you point me to bakers source code? im currently using quake-visual_cpp_express_2008 which is the code made to work on msvc2008. However the compiled exe crashes on startup on windows7 :/
works fine on xp though
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

ml.exe comes with 2008, so you don't need to download it for starters (although you do need to remove the quotes around the paths in the Custom Build Steps for the .s files).

I prefer to preprocess the .s files and include the generated .asm files in my project, thereby removing the .s files and gas2masm completely.

2008 also comes with all the headers and libs you need to compile GLQuake, so you don't need anything else.

For Windows 7 you should remove the "DXSDK" folder from the source distribution, which will force GLQuake to use the DirectX SDK files that come with 2008. Support for versions of DirectX prior to 8 has been removed from Windows 7. This is most likely one of the primary causes of crashes on Windows 7.

You'll also want to switch the character set for your project from Unicode to Multibyte. This is another cause of crashes as GLQuake will try to run Unicode versions of string functions against raw unsigned char datatypes otherwise, which will overflow arrays.

If I have time later on today I'll put together something that works
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Post by Charlieguitar »

That'd be awesome, thankyou! Im trying out the suggestions you guys have made so far, deleting DXSDK makes it not compile as for some reason my MSVC doesnt seem to include a newer dxsdk, so im currently downloading the latest SDK from microsoft and hoping i can use that.
Other than that i've changed it to multibyte also. Will post again when ive got the updated sdk working :)
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

Charlieguitar wrote:That'd be awesome, thankyou! Im trying out the suggestions you guys have made so far, deleting DXSDK makes it not compile as for some reason my MSVC doesnt seem to include a newer dxsdk, so im currently downloading the latest SDK from microsoft and hoping i can use that.
Other than that i've changed it to multibyte also. Will post again when ive got the updated sdk working :)
You're quite correct, I had checked for d3d9.h but missed the other files needed (dsound.h, etc). :oops:

Anyway, here's a modified project and source that compiles OK. I haven't yet tested it on Windows 7 though, but the steps I've used are the same as I've always used so I see no reason why it wouldn't work. http://www.sendspace.com/file/45rvwd

I won't get to test it for another 2 hours or so, but if it works for you in the meantime let me know and I'll post it on QuakeTastic or somewhere similar.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Post by Charlieguitar »

Its not finding the dx LIB files now for some reason
1>LINK : fatal error LNK1104: cannot open file 'dxguid.lib'

I copied the DXSDK folder into the project folder and added DXSDK in included libraries but for some reason its not finding dxguid.lib is there anywhere in particular i should put the two .lib files?
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Post by Charlieguitar »

thanks a lot for putting that together, forgot to mention that in my last post :D

Once i've got it compiled without error i'll let you know how it runs
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Post by Charlieguitar »

Ok now ive got it compiling but it still crashes on startup. Im guessing its a problem with my system then. Allthough regular quake.exe works fine and such. It must be a driver problem. I've got an nvidia card and the latest drivers so im not sure whats going on. This is the error i get when the engine crashes

Problem signature:
Problem Event Name: BEX
Application Name: glquake.exe
Application Version: 0.0.0.0
Application Timestamp: 4bb21fec
Fault Module Name: glquake.exe
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4bb21fec
Exception Offset: 0000ab2b
Exception Code: c0000409
Exception Data: 00000000
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1033
Additional Information 1: 09d7
Additional Information 2: 09d740809cb3ab11e7f83ce6899ed33b
Additional Information 3: aa6f
Additional Information 4: aa6fa615571124292e9dd85e3212317e
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

You need to run it under the debugger to find out what's happening here, but first of all let's get your build environment set up right.

First of all you need to tell VCPP where to find your DirectX SDK headers and libs; go to Tools | Options and set it up something like these. Don't worry if your paths are different to mine, or if I have extra stuff in there that you don't have; just focus on where you installed the DirectX SDK to, and make sure that they are at the top of the list.

Image

Image

Now you need to set up VCPP to run it under the debugger. First thing is to set the debug configuration as active, so go to Build | Configuration Manager and ensure that GL Debug is selected for Active Solution Configuration:

Image

Now in the Solution Explorer right-click on the GLQuake project and select Properties like so:

Image

Then set your linker properties to create the executable in your Quake folder, like so. Note that I've given it a different name to the regular GLQuake so that it won't overwrite it:

Image

Finally set your debugging properties similar to this. I always debug in a windowed mode so that if it crashes I can easily get back to the environment. I also like to debug in a separate gamedir so that anything I do won't stomp over ID1.

Image

All set, so hit Ctrl-Shift-B to build it, then when that's done hit F5 to run it in the debugger. It should break out of the executable at any crash point and go back to the environment, letting you inspect the values of variables, examine the call stack, and generally see what's going wrong.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Charlieguitar
Posts: 20
Joined: Mon Mar 29, 2010 8:45 pm

Post by Charlieguitar »

Well thanks for the in depth explanation thats really taught me a little more about msvc :D

The Debug output is spitting out the following when i run the engine with F5

test.exe': Loaded 'C:\Windows\SysWOW64\nvoglv32.dll'
The thread 'Win32 Thread' (0xa24) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xcd8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x10c4) has exited with code 0 (0x0).
A buffer overrun has occurred in test.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'.

test.exe is the name of my game exe for now.

Im not atall qualified enough to know what these errors mean or how to go about solving them unfortunately, any further advice would be great, im guessing that .dll has something to do with nvidia drivers though?
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

That's NVidia's OpenGL driver. Did you click on the Break button? It should throw you into the code editor with the line that caused the error highlighted. Paste that line here and we'll see if we can determine what's happening.

Also, here's one I made earlier on my own Windows 7/DXSDK/VCPP 2008 setup - it might be worth running that to see if it's a machine-specific issue. The source code used is exactly what I posted before.

http://www.sendspace.com/file/7qn225
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Post Reply