HOWTO: Compile Nexuiz on Windows using MinGW and MSYS

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

HOWTO: Compile Nexuiz on Windows using MinGW and MSYS

Postby Xeno » Sat Nov 03, 2007 4:08 am

This is how I finally got it to work on WinXP. Some of this might be superfluous (I installed stuff to be able to compile CPAN modules for Perl at the same time, so the Nexuiz client might not need everything here, but none of it hurts (or takes up much space)).

First, you need to install MinGW and MSYS to be able to compile the code. Download the following:


Run the MinGW Installer first and run the MSYS: Base System Installer last. DO NOT INSTALL ANYTHING TO A DIRECTORY WITH A SPACE IN ITS NAME! (e.g. "Program Files" or "Documents and Settings"). By default I think they both try to create directories in C:\. I hate clutter so I have a directory, C:\X\ for anything that might be sensitive to path names. My MinGW installation directory is thus C:\X\MinGW and my MSYS directory is C:\X\MSYS. To install the other stuff, you should be able to extract them directly into the MinGW directory. You'll be prompted to overwrite stuff. You should be able to overwrite everything (mostly just overlapping files, shouldn't make a difference which one you keep). If you're unsure, check the READMEs or the download sites for instructions.

When you install MinGW, make sure that you select the C and C++ compilers during the dialogue. When you install MSYS, make sure that you follow the command line dialogue that pops up and that you give it the correct path to your MinGW directory, using FORWARD slashes (/)... thus I had to enter it as C:/X/MinGW.



Ok, now download the quake 1 source code files at ftp://ftp.idsoftware.com/idstuff/source/q1source.zip. You need the following files from the quake 1 source (look in q1source.zip\WinQuake\dxsdk\SDK\INC):
    ddraw.h
    dinput.h
    dsound.h


Create a new folder in MinGW\include\ and name it "darkplaces". Move the three files here.

Finally, go to Nexuiz\sources\ and extract the enginesource.zip (the file will contain a date in it's name, e.g. enginesource20070531.zip) file to a folder somewhere (in you created the directory C:\X\, extract the folder there... avoid placing it somewhere with a name in the path (it might work, I didn't bother to try... I was frustrated enough). Note that the desktop has a space in its path (it's in "Documents and Settings"). This folder will contain another folder, "darkplaces".

Now, open a command prompt (press the windows key and R, then type "cmd" and hit enter). (yeah, I realize that anyone who wants to compile the client from source probably knows how to open the command prompt).

Enter "cd" followed by a space and the full path name to the darkplaces directory in the folder to which you extracted the enginesource.zip file. (e.g. "cd C:\X\enginesource20070531\darkplaces").

Now you need to set the path variabe to contain the paths to the MinGW and MSYS files (so that the command prompt can find them). If you installed everything to its default locations (C:\), then enter this (provided that you have the same versions listed above):

Code: Select all
PATH=C:\msys\1.0\bin;C:\MinGW\bin;C:\MinGW\mingw32\bin;%PATH%


If you installed everything to C:\X\ as I did, enter this.:

Code: Select all
PATH=C:\X\msys\1.0\bin;C:\X\MinGW\bin;C:\X\MinGW\mingw32\bin;%PATH%


If you installed everything somewhere else, just replace the three paths with the correct ones. If you don't want to have to type that every time that you start a new command prompt session, you could add them to the path variable permanently (Control Panel -> System -> Advanced -> Environment Variables -> System Variables -> Path).



Now, if you placed the ddraw.h, dinput.h, and dsound.h in MinGW\include\darkplaces, and MinGW is in it's default location (C:\MinGW), enter this:
Code: Select all
make DP_MAKE_TARGET=mingw CC="gcc -I/c/MinGW/include/darkplaces" cl-release


If you placed the files somewhere else, replace "c/MinGW/include/darkplaces" with the full path, using FORWARD SLASHES and without a colon after "c". E.g. I used this:

Code: Select all
make DP_MAKE_TARGET=mingw CC="gcc -I/c/x/MinGW/include/darkplaces" cl-release


That should be it.



Thanks to div and esteel for their help.


If there are any mistakes, let me know right away so that I can fix them.

EDIT 08/03/29 - SDL
erroneus wrote:double yay, i got sdl to compile, i uninstalled everything and started from scratch,
the sdl libs are located here for any other people who are new to coding like me
http://www.libsdl.org/release/SDL-devel ... w32.tar.gz
all this gets copied to the mingw directory aswell as the other stuff.

the only other thing that i did, i copied the .h files from Nexuiz\Nexuiz-SDL.app\Contents\Frameworks\SDL.framework\Versions\A\Headers (included in the game)
i over wrote the files that i downloaded, i dunno if it was good or bad, but it worked on the first try.

the difference i'm looking at is the way the sdl version handled joystick input. the cvars are totally different compared to the CL version.
Last edited by Xeno on Sat Mar 29, 2008 3:45 am, edited 1 time in total.
Xeno
peregrinus originis incognitae
 
Posts: 396
Joined: Wed Nov 15, 2006 10:42 pm

Postby divVerent » Sun Nov 04, 2007 12:32 am

If you use "cl-nexuiz" instead of "cl-release", it will make a nexuiz.exe instead of a darkplaces.exe, which gets the right icon. Other than the icon, the files are identical, so if you follow Xeno's description, just rename the file at the end to nexuiz.exe, or it won't detect Nexuiz (it uses its own file name to find out whether it should load Quake or Nexuiz).
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

libvorbisfile

Postby :) » Sun Nov 04, 2007 1:52 am

I just got libvorbis-1.2.0 to create a dll using msys, had to use the patch here: http://fuppes-svn.ulrich-voelkel.de/pat ... msys.patch (solves the problem where the makefile wasn't linking to libogg properly), but with the dlls properly created they don't work in the game.
Is there anything I can do in DP to see why the dlls aren't working?
:)
Keyboard killer
 
Posts: 590
Joined: Tue Feb 28, 2006 9:09 pm

Postby divVerent » Sun Nov 04, 2007 8:28 am

Not really. What does it say when it can't load them? Did you rename DLLs in the process?
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Blµb » Sun Nov 04, 2007 9:59 am

divVerent wrote:If you use "cl-nexuiz" instead of "cl-release", it will make a nexuiz.exe instead of a darkplaces.exe, which gets the right icon. Other than the icon, the files are identical, so if you follow Xeno's description, just rename the file at the end to nexuiz.exe, or it won't detect Nexuiz (it uses its own file name to find out whether it should load Quake or Nexuiz).


Oh really? My patch binaries are named darkplaces.exe and nobody complained about them not detecting nexuiz O.o
Blµb
Alien trapper
 
Posts: 277
Joined: Thu Mar 29, 2007 1:49 pm

Postby divVerent » Sun Nov 04, 2007 10:13 am

Maybe it's a difference on Windows... it does not do that here. Unless you specify the command line parameter "-nexuiz", of course...
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby dfkgmasdfnasodrg » Sun Nov 04, 2007 12:13 pm

nice work there Xeno
dfkgmasdfnasodrg
Alien
 
Posts: 153
Joined: Sat Mar 04, 2006 4:21 pm

Postby esteel » Sun Nov 04, 2007 12:25 pm

i seem to remember on windows (or in general)? the engine also includes the current working directory name to deceide the game..

On linux i also compile darkplaces but create links named nexuiz* to it. because that way its easier to create debug, normal, profiling binaries.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby :) » Sun Nov 04, 2007 4:29 pm

divVerent wrote:Not really. What does it say when it can't load them? Did you rename DLLs in the process?

The problem I didn't recognize before was that libvorbisfile.dll depends on libvorbis-0.dll, but the engine looks for libvorbis.dll
I worked around that by using two copies of libvorbis.dll, with each name, to satisfy both requirements.
Obviously, that is a suboptimal solution, but I did now get to the point where the new libraries work.
:)
Keyboard killer
 
Posts: 590
Joined: Tue Feb 28, 2006 9:09 pm

Postby divVerent » Sun Nov 04, 2007 5:21 pm

And it's exactly what I want to avoid. Isn't there any way to change the name of a DLL a library depends on? Or to change the .a and .la file that links to it? Or to make libogg make a libogg.dll and not a libogg-0.dll?
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Next

Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 0 guests

cron