Difference between revisions of "Building EDuke32 on Windows" - EDukeWiki

# Difference between revisions of "Building EDuke32 on Windows"

From EDukeWiki

Revision as of 21:03, 28 June 2011 (view source) Hendricks266 (talk | contribs) ← Older edit | Latest revision as of 10:36, 2 June 2016 (view source) Hendricks266 (talk | contribs) (→‎MinGW-w64)
(42 intermediate revisions by 6 users not shown)
Line 1: | Line 1:
− | ==Building on Windows with MinGW/GNU Make== | + | {{Distribution intro}}
− | *'''[http://sourceforge.net/downloads/mingw/ automated MinGW installer] | + | == Getting source files ==
− | *'''[http://www.nasm.us/ NASM]''' |
− | *'''[http://alleg.sourceforge.net/files/dx70_mgw.zip DirectX 7 SDK for MinGW]''' |
− | *'''[http://alleg.sourceforge.net/files/dx80_mgw.zip DirectX 8 SDK for MinGW]''' |
− | First, install MinGW and MSYS using the automated MinGW installer. This should be relatively straightforward and will install MSYS (the shell and utility commands) and MinGW (the compiler suite). This guide assumes that they're installed in '''c:/MinGW''' and '''c:/MinGW/msys''' -- from the wording on their page, anything else is BAD. | + | :''See [[Acquiring the EDuke32 Source Code]].''
− | Next, download NASM and extract its contents to the MinGW/bin folder, so nasm.exe is located there. | + | ==Building on Windows with MinGW/GCC/GNU Make==
− | After that, download, extract, and run [[File:MinGW EDuke32 Setup Helper.zip]]. It will help ensure that everything is installed correctly. | + | This setup is personally used by [[Hendricks266]].
− | Finally, download the above DirectX SDKs and extract them to directories, such as '''c:/MinGW/sdks/dx70_mgw''' and '''c:/MinGW/sdks/dx80_mgw'''. If you don't want to take an additional step later on of configuring these directories, copy them (7 first, then 8) over '''c:/MinGW/'''. | + | ===setup===
− | ====configuration==== | + | ==== [http://mingw-w64.sourceforge.net/ MinGW-w64] ====
− | If you opted to keep your compiler clean in the previous paragraph, you will need to tell EDuke32 where to find the SDK. The recommended way to do this is to append the definition the make command when building, like the following examples: |
− | make DXROOT=c:/MinGW/sdks/dx80_mgw | + | MinGW-GCC is the ''de facto'' standard for free compilers on Windows.
− | make RELEASE=0 DXROOT=c:/MinGW/sdks/dx80_mgw |
− | If your directory is different, change it to yours. Keep in mind the lowercase drive letter and the forward slashes instead of backslashes. | + | #First, install MSYS using the '''[http://sourceforge.net/downloads/mingw/ automated MinGW installer]'''. Make sure all MSYS components are installed. This should be relatively straightforward and will install the shell and utility commands.
| + | #*This guide assumes that they're installed in '''c:/MinGW''' and '''c:/MinGW/msys''' -- from the wording on their page, anything else is BAD.
| + | #Next, download '''[http://www.nasm.us/ NASM]''' and extract its contents to MSYS' bin folder, so nasm.exe is located there.
| + | #*Sample path: <code>C:\MinGW\msys\1.0\bin\nasm.exe</code>
| + | #Download any and all MinGW-w64 packages you would like. These contain the entire toolchain. Win32 threads are preferred to POSIX threads, and seh (for 64-bit) and dwarf (for 32-bit) exception handling methods are preferred to sjlj.
| + | #*[http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/ Targeting Win32 (i686)]
| + | #*[http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/ Targeting Win64 (x86_64)]
| + | #You are going to want to extract these in an organized fashion. Use these paths unless you are prepared to make edits to the batch files included with the Setup Helper below.
| + | #*<code>C:\MinGW-w64\mingw32\bin\gcc.exe</code>
| + | #*<code>C:\MinGW-w64\mingw64\bin\gcc.exe</code>
| + | #After that, download, extract, and run the '''[[MinGW EDuke32 Setup Helper]]'''. (You may need to run it as an administrator for it to take full effect.) It will help ensure that everything is installed correctly as well as modify your PATH environment variable for you so you can run the compiler from any directory allowing you to compile EDuke32.
| + | #Unfortunately, one deficiency in MinGW-w64 is that the each of the two targets (32-bit and 64-bit) require their own separate executables, instead of using one binary with the <code>-arch</code> parameter as on other platforms. When building EDuke32, the executables generated will match the target of whatever compiler is the highest in PATH--no extra make parameters needed.
| + | #*The Setup Helper sets up the 64-bit compiler by default. If you would like to change the default, run the included <code>i686-MinGW-w64.bat</code>. You can revert with <code>x86_64-MinGW-w64.bat</code>.
| + | #**If you have configured Windows Explorer so that the "Launch folder windows in a separate process" option is enabled, you will need to restart explorer.exe (either by terminating and relaunching it in Task Manager, or restarting your computer) for changes made to persistent PATH to take effect in command prompt windows launched from within Explorer.
| + | #*Otherwise, for a quick test, execute the commands <code>override32</code> and <code>override64</code> to change the selected compiler for the current command prompt window only. (These are installed by the Setup Helper.)
| + | #One final note: If you are trying to build '''ebacktrace1.dll''' and are getting errors about a missing "bfd.h", you need to copy the following files from <code><nowiki><root>\include\</nowiki></code> to <code><nowiki><root>\<target>-w64-mingw32\include\</nowiki></code>:
− | The alternate method is to make some adaptations to the files describing the build process, the ''Makefile''s. Usually, only two files need to be edited: '''Makefile''' and '''build/Makefile'''. For each of them, the line in question sets the path where the DirectX 8 SDK is located, like this: | + | ansidecl.h
− | DXROOT=c:/MinGW/sdks/dx80_mgw | + | bfd.h
− | Simply change it to your DX SDK installation path. | + | bfdlink.h
| + | dis-asm.h
| + | symcat.h
− | ====compiling==== | + | ==== [http://clang.llvm.org/ clang] ====
− | Now that we've got everything together, go to the base directory containing the EDuke32 source code, type | + |
| + | Clang is another compiler that complements and works closely in tandem with MinGW. It is mainly used for its highly human readable diagnostic descriptions of compiler errors and warnings.
| + |
| + | Installation is simple. [http://llvm.org/releases/ Download the binaries] marked for "Mingw32/x86", which may be marked "''Experimental''". From here you have two options. You can extract the contents of the archive in such a way so that its directory structure merges with MinGW's--you will have <code>C:\MinGW\msys\1.0\bin\clang.exe</code> and so on. The other is to extract the data to its own folder, possibly simplifying the name, and adding it on its own to PATH--<code>C:\clang\bin\clang.exe</code>.
| + |
| + | To build with clang, append the setting <code>CLANG=1</code> to your ''make'' invocation.
| + |
| + | ===compiling===
| + | Now that we've got everything together, [[Working with the Windows Command Prompt|navigate a command prompt window]] to the base directory containing the EDuke32 source code, type
| make |  | make
− | and cross fingers: this will attempt to build EDuke32 and Mapster32. To compile only either the game or the editor, simply give ''make'' the name of the executable, like | + | and cross your fingers: this will attempt to build EDuke32 and Mapster32. If you ran the '''MinGW EDuke32 Setup Helper''' earlier in the instructions, it should work.
| + |
| + | To compile only either the game or the editor, simply give ''make'' the name of the executable, like
| make eduke32.exe |  | make eduke32.exe
− | To compile a version suitable for later debugging with GDB, prepend ''RELEASE=0'' to the command, like this: | + | To compile a version suitable for later debugging with GDB, append ''RELEASE=0'' to the command, like this:
− | RELEASE=0 make mapster32.exe | + | make RELEASE=0
| To have more useful function names when doing a backtrace (see '''debugging''' below), it is also advisable to disable stack protectors, like this: |  | To have more useful function names when doing a backtrace (see '''debugging''' below), it is also advisable to disable stack protectors, like this:
− | F_STACK_PROTECTOR_ALL=-fno-stack-protector RELEASE=0 make mapster32.exe | + | make F_STACK_PROTECTOR_ALL=-fno-stack-protector RELEASE=0
− | Finally, if you are building on GCC 3, prepend ''GCC_MAJOR=3''. |
− | ====troubleshooting==== | + | ===troubleshooting===
| If something doesn't go as planned, don't despair. Most issues are resolved rather quickly. |  | If something doesn't go as planned, don't despair. Most issues are resolved rather quickly.
Line 44: | Line 65:
| * Finally, if the executable starts but aborts shortly thereafter, a ''dynamic link library'' may be missing. Usually you'll get a helpful message with its name: check the MinGW download page then. |  | * Finally, if the executable starts but aborts shortly thereafter, a ''dynamic link library'' may be missing. Usually you'll get a helpful message with its name: check the MinGW download page then.
− | ====debugging==== | + | ===debugging===
− | The most insidious types of bugs are those that occur randomly and with no apparent pattern. To help the developers tracing down ''crashes'' happening this way, you could try running a debug version of the executable under the GNU debugger until the crash happens. To do this, start it like this (mapster32.exe being an example): |
− | gdb --args mapster32.exe ''[additional arguments...]'' |
− | and enter the |
− | r |
− | (run) command at the GDB prompt. When the program crashes, you will be taken back to the prompt. Enter |
− | bt |
− | (backtrace) there. This will print out the location where the crash occurred and serve as a first diagnostic to the developers. |
− |  |
− | ==Building on Windows with Microsoft Visual C++== |
− |  |
− | note: this was what worked for me, there are probablly better ways. If you want to document them go right ahead --plugwash. |
− | get visual c++ express edition from http://www.microsoft.com/express/download/ and install it. The paths in theese instructions assume it is installed in the default location. | + | ''See [[Troubleshooting EDuke32#Debugging|Troubleshooting EDuke32]].''
− | unfortunately ml.exe is missing from the express edition, lukilly there is a copy in the freely downloadable windows server 2003 ddk which can be obtained from http://www.microsoft.com/whdc/devtools/ddk/default.mspx . Install this and copy ml.exe to your visual studio bin directory | + | ==Building on Windows with Microsoft command line compilers==
| + | EDuke32 can be built using freely downloadable Microsoft tools. Unfortunately, Microsoft does not appear to offer a single package containing all the needed tools so it is necessary to get them from several different places.
− | windows.h, windef.h, winnt.h,basetsd.h,guiddef.h, pshpack4.h, pshpack1.h, pshpack2.h, pshpack4.h, pshpack8.h, poppack.h, winbase.h, winerror.h, wingdi.h, winuser.h, tvout.h, winnls.h, wincon.h, winver.h, winreg.h, winnetwk.h, winsvc.h, mcx.h, imm.h, shlobj.h, ole2.h, objbase.h, rpc.h, rpcdce.h, rpcdcep.h, rpcnsi.h, rpcnterr.h, rpcasync.h, rpcndr.h, rpcnsip.h, wtypes.h, unknwn.h, cguid.h, urlmon.h, oleidl.h, servprov.h, msxml.h , oaidl.h, propidl.h, oleauto.h, prsht.h, commctrl.h, shlguid.h, isguids.h, exdisp.h, ocidl.h, docobj.h, shldisp.h, specstrings.h, winsock2.h, qos.h, ws2tcpip.h, ddraw.h, dinput.h, windowsx.h, shellapi.h, winresrc.h, winuser.rh, commctrl.rh, dde.rh, winnt.rh, dlgs.h, mmsystem.h, dsound.h, d3dtypes.h, user32.lib, gdi32.lib, shell32.lib, dxguid.lib, winmm.lib, wsock32.lib, commctl32.lib, glu32.lib, uuid.lib, cderr.h, dde.h, ddeml.h, lzexpand.h, nb30.h, winperf.h, winsock.h, wincrypt.h, winscard.h, winioctl.h, winsmcard.h, commdlg.h and the whole gl include directory also seem to be missing, again theese can be obtained from the windows server 2003 ddk. With the exception of cderr.h, ddeml.h, winperf.h and lzexpand.h which I got from the wnet directory and a few files that were only found in a generic crt directory in the ddk I used the win2K versions from that ddk. | + | #Download and install the Windows SDK from http://www.microsoft.com/download/en/confirmation.aspx?id=11310 and accept the defaults in the installer.
| + | #Download and install the WDK from http://www.microsoft.com/download/en/details.aspx?id=11800 and select the "full development environment" option in the installer.
| + | #Download and install Visual C++ 2008 Express from http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express
| + | #*Note that the following instructions assume the above programs were installed in the default locations on a 32-bit Windows system. If they are installed in other locations then paths in later instructions will need to be adjusted.
| + | #Copy lib.exe from C:\Program Files\Microsoft Visual Studio 9.0\VC\bin to C:\WinDDK\7600.16385.1\bin\x86
| + | #Copy mt.exe from C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin to C:\WinDDK\7600.16385.1\bin\x86
| + | #Start the "Windows XP x86 Free Build Environment" from the WDK
| + | #Set up paths, etc:
− | I had to modify ws2tcpip.h to add the following typedef just before the final #ENDIF | + | {| class="wikitable"
| + | |<code>set Include=C:\WinDDK\7600.16385.1\inc\api;C:\WINDDK\7600.16385.1\inc\crt</code>
− | typedef int socklen_t; | + | <code>set Lib=C:\WinDDK\7600.16385.1\lib;C:\WINDDK\7600.16385.1\lib\wxp\i386;C:\WINDDK\7600.16385.1\lib\wlh\i386;C:\oggvorbis-win32sdk-1.0.1\lib;C:\WINDDK\7600.16385.1\lib\Crt\i386</code>
− | This was fixed in the "winxp" version of that file included with the ddk but trying to use the winxp version resulted in a demand for another header that I could not meet with bits from the ddk. | + | <code>PATH=C:\WinDDK\7600.16385.1\tools\sdv\bin;C:\WinDDK\7600.16385.1\bin\x86\oacr;C:\WinDDK\7600.16385.1\tools\pfd\bin\bin\x86;C:\WinDDK\7600.16385.1\tools\tracing\i386;C:\WinDDK\7600.16385.1\bin\x86;C:\WinDDK\7600.16385.1\bin\x86\x86;C:\WinDDK\7600.16385.1\bin\SelfSign;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem</code>
| + | |}
− | I also had to modify windows.h to not include winpref.h which I didn't have | + | Finally, [[Working with the Windows Command Prompt|change to the directory containing your EDuke32 source tree and run]]:
− | download http://www.vorbis.com/files/1.0.1/windows/OggVorbis-win32sdk-1.0.1.zip and extracted it (I extracted it in c:\ and work on that assumption in theese instructions) |
− |  |
− | start the visual studio 2005 command prompt |
− |  |
− | clean up some environment variables that the vs command prompt forgets to clean, add the include paths for vorbis to the include file path and add the path for the vorbis libs to the library path |
− |  |
− | PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem |
− | set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\oggvorbis-win32sdk-1.0.1\include |
− | set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;C:\oggvorbis-win32sdk-1.0.1\lib |
− | change to the build subdirectory of your eduke32 tree and run |
− | nmake -f Makefile.msvc |
− | cd ..\ |
| nmake -f Makefile.msvc |  | nmake -f Makefile.msvc
− | ==Building on Windows with Microsoft Visual Studio 2008== | + | ==Building on Windows with Microsoft Visual Studio 2010==
− | To compile EDuke32 with VS08, you will need to install the following: | + | ===Preparation===
− | * '''[http://www.vorbis.com/files/1.0.1/windows/OggVorbis-win32sdk-1.0.1.zip OggVorbis-win32sdk-1.0.1.zip]''' - Ogg Vorbis libraries | + | First, follow [[#Getting source files|the procedure above]] to download the source code. Alternatively:
− | * Plus a '''DirectX SDK''' (note that you need the SDK- '''Source Development Kit''', not the DDK- Driver Development Kit), DirectX March 2009 or a previous version, such as the '''DirectX 7''' SDK which is confirmed to work. |
− | Install each of these locally to somewhere where you can find them easily, such as the Program Files directory. | + | ====AnkhSVN====
− |  |
− | ===Using SVN=== |
− |  |
− | If you want to use an SVN to build the game read this section. If you already have the latest source files or don't want to use an SVN, skip to the next part. |
| First, you need to download a free SVN plugin for Visual Studio, such as: |  | First, you need to download a free SVN plugin for Visual Studio, such as:
Line 106: | Line 109:
| # Navigate through the menus: '''File &rarr; Subversion &rarr; Open from Subversion...''' |  |
| # Type in the URL of the EDuke32 SVN. |  |
− | # Select the '''eduke32.vcproj''' file and click Open. | + | # Select the '''eduke32.vcxproj''' file and click Open.
| AnkhSVN now asks you where to save the project locally. |  | AnkhSVN now asks you where to save the project locally.
− | '''IMPORTANT!''' EDuke32 is a makefile project, as such, it needs to be located in a directory with only [http://en.wikipedia.org/wiki/8.3_filename 8 characters] (for example '''C:\EDuke32\''' or '''D:\Source\EDuke32'''). | + | '''IMPORTANT!''' The EDuke32 source should be located in a directory with no spaces in its name (for example '''C:\EDuke32\''' or '''D:\Source\EDuke32''').
− | Choose the local directory, the '''Type''' drop-down menu should be set to '''Latest Version''', click on OK to save the project on your hard drive. The program now downloads the latest files from the SVN. | + | Choose the local directory, the '''Type''' drop-down menu should be set to '''Latest Version''', click on OK to save the project on your hard drive. The program now downloads the latest files from SVN.
| When done, EDuke32 is shown as your current solution, now you can continue onto either fiddling with the source or just compiling it. |  | When done, EDuke32 is shown as your current solution, now you can continue onto either fiddling with the source or just compiling it.
− | ===Includes=== | + | ===Compiling===
− | As already mentioned before, EDuke32 is a makefile project so you cannot include OGGVorbis in the '''Project &rarr; Properties''' menu as usual, but you will need to add the includes in the global properties: | + | Either click on the green play button, or navigate the menus to '''Build &rarr; Build eduke32''' and VS2010 starts compiling the executables.
− |  |
− | # Navigate to '''Tools &rarr; Options'''. |
− | # Click on '''Show all settings''' to show the settings we need to change. |
− | # Open the '''Projets and Solutions''' category and choose '''VC++ Directories'''. |
− |  |
− | Now we need to link the Include directories. |
− |  |
− | ====General Include directories==== |
− |  |
− | Make sure the Platform is set to Win32 and select '''Include files''' from the '''Show directories for:''' -drop down menu. |
− |  |
− | Click on an empty row and add the local directory names for OGGVorbis and DirectX SDK. For example: |
− | * C:\Program Files\oggvorbis-win32sdk-1.0.1\include |
− | * C:\Program Files\DirectX 7 SDK\include |
− |  |
− | Notice how each directory has the include subdirectory chosen ("\include\"). If your version differs, try finding the correct directory for each or the program will not compile properly. |
− |  |
− | The new linked directories are saved automatically so don't click on OK, it will only close the Options menu. |
− |  |
− | Next up, we need to link the libaries. |
− |  |
− | ====Library directories==== |
− |  |
− | Next, Select '''Library files''' from the '''Show directories for:''' -drop down menu. |
− |  |
− | Click on an empty row and add the local directory names for OGGVorbis and DirectX SDK. For example: |
− | * C:\Program Files\oggvorbis-win32sdk-1.0.1\lib |
− | * C:\Program Files\DirectX 7 SDK\lib |
− |  |
− | Notice how each directory has the library subdirectory chosen (either '''lib''' or '''libs'''). |
− |  |
− | Now click on OK to exit the Options menu. |
− |  |
− | ===Compiling=== |
− | Either click on the green play button, or navigate the menus to '''Build &rarr; Build eduke32''' and VS08 starts compiling the executables. | + | You will probably see a lot of warnings with wrong datatype conversions but these don't affect the outcome.
− | You will probably see alot of warnings with wrong datatype conversions but these don't affect the outcome. | + | [[Category:Distribution documentation]]

## Latest revision as of 10:36, 2 June 2016

EDuke32 Distribution

Download · Source Code · APT repository · Packages
Building from source on: Linux · Windows · Mac OS X

## Getting source files

  See Acquiring the EDuke32 Source Code.

## Building on Windows with MinGW/GCC/GNU Make

This setup is personally used by Hendricks266.

### setup

#### MinGW-w64

MinGW-GCC is the de facto standard for free compilers on Windows.

1. First, install MSYS using the automated MinGW installer. Make sure all MSYS components are installed. This should be relatively straightforward and will install the shell and utility commands.
   - This guide assumes that they're installed in c:/MinGW and c:/MinGW/msys -- from the wording on their page, anything else is BAD.
2. Next, download NASM and extract its contents to MSYS' bin folder, so nasm.exe is located there.
   - Sample path: `C:\MinGW\msys\1.0\bin\nasm.exe`
3. Download any and all MinGW-w64 packages you would like. These contain the entire toolchain. Win32 threads are preferred to POSIX threads, and seh (for 64-bit) and dwarf (for 32-bit) exception handling methods are preferred to sjlj.
   - Targeting Win32 (i686)
   - Targeting Win64 (x86_64)
4. You are going to want to extract these in an organized fashion. Use these paths unless you are prepared to make edits to the batch files included with the Setup Helper below.
   - `C:\MinGW-w64\mingw32\bin\gcc.exe`
   - `C:\MinGW-w64\mingw64\bin\gcc.exe`
5. After that, download, extract, and run the MinGW EDuke32 Setup Helper. (You may need to run it as an administrator for it to take full effect.) It will help ensure that everything is installed correctly as well as modify your PATH environment variable for you so you can run the compiler from any directory allowing you to compile EDuke32.
6. Unfortunately, one deficiency in MinGW-w64 is that the each of the two targets (32-bit and 64-bit) require their own separate executables, instead of using one binary with the `-arch` parameter as on other platforms. When building EDuke32, the executables generated will match the target of whatever compiler is the highest in PATH--no extra make parameters needed.
   - The Setup Helper sets up the 64-bit compiler by default. If you would like to change the default, run the included `i686-MinGW-w64.bat`. You can revert with `x86_64-MinGW-w64.bat`.
     - If you have configured Windows Explorer so that the "Launch folder windows in a separate process" option is enabled, you will need to restart explorer.exe (either by terminating and relaunching it in Task Manager, or restarting your computer) for changes made to persistent PATH to take effect in command prompt windows launched from within Explorer.
   - Otherwise, for a quick test, execute the commands `override32` and `override64` to change the selected compiler for the current command prompt window only. (These are installed by the Setup Helper.)
7. One final note: If you are trying to build ebacktrace1.dll and are getting errors about a missing "bfd.h", you need to copy the following files from `<root>\include\` to `<root>\<target>-w64-mingw32\include\`:

    ansidecl.h
    bfd.h
    bfdlink.h
    dis-asm.h
    symcat.h

#### clang

Clang is another compiler that complements and works closely in tandem with MinGW. It is mainly used for its highly human readable diagnostic descriptions of compiler errors and warnings.

Installation is simple. Download the binaries marked for "Mingw32/x86", which may be marked "Experimental". From here you have two options. You can extract the contents of the archive in such a way so that its directory structure merges with MinGW's--you will have `C:\MinGW\msys\1.0\bin\clang.exe` and so on. The other is to extract the data to its own folder, possibly simplifying the name, and adding it on its own to PATH--`C:\clang\bin\clang.exe`.

To build with clang, append the setting `CLANG=1` to your make invocation.

### compiling

Now that we've got everything together, navigate a command prompt window to the base directory containing the EDuke32 source code, type

    make

and cross your fingers: this will attempt to build EDuke32 and Mapster32. If you ran the MinGW EDuke32 Setup Helper earlier in the instructions, it should work.

To compile only either the game or the editor, simply give make the name of the executable, like

    make eduke32.exe

To compile a version suitable for later debugging with GDB, append RELEASE=0 to the command, like this:

    make RELEASE=0

To have more useful function names when doing a backtrace (see debugging below), it is also advisable to disable stack protectors, like this:

    make F_STACK_PROTECTOR_ALL=-fno-stack-protector RELEASE=0

### troubleshooting

If something doesn't go as planned, don't despair. Most issues are resolved rather quickly.

- If you see a barrage of error messages saying that some symbols are not defined, check whether you have all necessary prerequisites like the DirectX SDK installed and that the paths in the Makefile point to the right location.
- If you get errors at the end of the build process (technically, at link time), there's usually a problem with the libraries -- the linker can't find one or more .a files [needs explanation].
- Finally, if the executable starts but aborts shortly thereafter, a dynamic link library may be missing. Usually you'll get a helpful message with its name: check the MinGW download page then.

### debugging

See Troubleshooting EDuke32.

## Building on Windows with Microsoft command line compilers

EDuke32 can be built using freely downloadable Microsoft tools. Unfortunately, Microsoft does not appear to offer a single package containing all the needed tools so it is necessary to get them from several different places.

1. Download and install the Windows SDK from http://www.microsoft.com/download/en/confirmation.aspx?id=11310 and accept the defaults in the installer.
2. Download and install the WDK from http://www.microsoft.com/download/en/details.aspx?id=11800 and select the "full development environment" option in the installer.
3. Download and install Visual C++ 2008 Express from http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express
   - Note that the following instructions assume the above programs were installed in the default locations on a 32-bit Windows system. If they are installed in other locations then paths in later instructions will need to be adjusted.
4. Copy lib.exe from C:\Program Files\Microsoft Visual Studio 9.0\VC\bin to C:\WinDDK\7600.16385.1\bin\x86
5. Copy mt.exe from C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin to C:\WinDDK\7600.16385.1\bin\x86
6. Start the "Windows XP x86 Free Build Environment" from the WDK
7. Set up paths, etc:

`set Include=C:\WinDDK\7600.16385.1\inc\api;C:\WINDDK\7600.16385.1\inc\crt`

`set Lib=C:\WinDDK\7600.16385.1\lib;C:\WINDDK\7600.16385.1\lib\wxp\i386;C:\WINDDK\7600.16385.1\lib\wlh\i386;C:\oggvorbis-win32sdk-1.0.1\lib;C:\WINDDK\7600.16385.1\lib\Crt\i386`

`PATH=C:\WinDDK\7600.16385.1\tools\sdv\bin;C:\WinDDK\7600.16385.1\bin\x86\oacr;C:\WinDDK\7600.16385.1\tools\pfd\bin\bin\x86;C:\WinDDK\7600.16385.1\tools\tracing\i386;C:\WinDDK\7600.16385.1\bin\x86;C:\WinDDK\7600.16385.1\bin\x86\x86;C:\WinDDK\7600.16385.1\bin\SelfSign;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem`

Finally, change to the directory containing your EDuke32 source tree and run:

    nmake -f Makefile.msvc

## Building on Windows with Microsoft Visual Studio 2010

### Preparation

First, follow the procedure above to download the source code. Alternatively:

#### AnkhSVN

First, you need to download a free SVN plugin for Visual Studio, such as:

- AnkhSVN

Install AnkhSVN, you can find help for installing it from it's website.

1. Launch Microsoft Visual Studio.
2. Navigate through the menus: File → Subversion → Open from Subversion...
3. Type in the URL of the EDuke32 SVN.
4. Select the eduke32.vcxproj file and click Open.

AnkhSVN now asks you where to save the project locally.

IMPORTANT! The EDuke32 source should be located in a directory with no spaces in its name (for example C:\EDuke32\ or D:\Source\EDuke32).

Choose the local directory, the Type drop-down menu should be set to Latest Version, click on OK to save the project on your hard drive. The program now downloads the latest files from SVN.

When done, EDuke32 is shown as your current solution, now you can continue onto either fiddling with the source or just compiling it.

### Compiling

Either click on the green play button, or navigate the menus to Build → Build eduke32 and VS2010 starts compiling the executables.

You will probably see a lot of warnings with wrong datatype conversions but these don't affect the outcome.

Retrieved from "http://wiki.eduke32.com/w/index.php?title=Building_EDuke32_on_Windows&oldid=12353"
Category:

- Distribution documentation