]> de.git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Archive/Compiling_In_Windows.md
test
[xonotic/xonotic.wiki.git] / Archive / Compiling_In_Windows.md
1 Compiling In Windows
2 ====================
3
4 [Same dir plain](Outdated_Compiling_in_Windows)  
5 [Same dir rel](./Outdated_Compiling_in_Windows)  
6 [Same dir abs](/Archive/Outdated_Compiling_in_Windows)  
7
8 [Home plain](Home)  
9 [Home rel](../Home)  
10 [Home abs](/Home)  
11
12 [Subdir plain](Recording/Democapture)  
13 [Subdir rel](../Recording/Democapture)  
14 [Subdir abs](/Recording/Democapture)  
15
16 [Md plain](Recording/Democapture.md)  
17 [Md rel](../Recording/Democapture.md)  
18 [Md abs](/Recording/Democapture.md)  
19
20 **This guide has been replaced by a shorter alternative.** This guide should still work, and get you a standalone MinGW/MSYS environment with access to msysgit. The new method only makes use of msysgit and is therefore easier and faster to set up. See the [Repository Access](https://gitlab.com/xonotic/xonotic/wikis/Repository_Access#windows) page.
21
22 This is an unofficial updated version of the outdated [Compiling in Windows](Outdated_Compiling_in_Windows) page. There are no more automated tools in this version of the guide.
23
24 You will need about 10 gigabytes of disk space to keep the sources (the uncompressed texture files are quite large and git keeps a backup copy, doubling the actual size of the sources).
25
26 Step 1: installing the prerequisites
27 ------------------------------------
28
29 To compile and run Xonotic in Windows, you will need to download the following. Do not install anything yet, this is covered in the next section.
30
31 -   The latest version of [MinGW](http://sourceforge.net/projects/mingw/files/). At the time of writing this guide, mingw provides an installer (mingw-get-inst). More up-to-date information on how to get MinGW can be found on http://mingw.org
32 -   [msysgit](https://code.google.com/p/msysgit/downloads/list). Make sure you get the latest **full installer for official Git** (not the self-contained packages). At the time of writing this, the latest installer is called Git-1.7.11-preview20120710.exe.
33
34 ### Installing MinGW
35
36 These instructions apply to mingw-get-inst. Run the installer. When setting up the path, if you do not pick the default, make at least sure that the installation path you choose contains no space in it. Thus, Program Files is out of question.
37
38 When you reach the “select components” section, you need to check “MSYS Basic System” (**not** “MinGW Developer Toolkit”). You will also need the C compiler, which should be selected by default.
39
40 When the setup is complete, you will get a “MinGW Shell” in your start menu. This is a Unix-like shell that you will soon use to manage and compile the Xonotic source files. It will also be used to launch the game.
41
42 ### Installing msysgit
43
44 Run the installer.
45 At the component selection screen (screenshot), uncheck the “Associate .sh files” option.  
46
47 ![](assets/images/git-1-components.png)
48
49 Windows Explorer Integration can also optionnally be unselected — it is only useful if you plan on contributing and do not like using git purely from the command line to do so.
50 When you get to the PATH adjusting screen (screenshot), you need to select the second option (Run Git from the Windows Command Prompt).  
51
52 ![](assets/images/git-2-path.png)
53
54 This ensures that git can be run from the MinGW shell, as we will not use the shell that comes with msysgit for this.
55 Finally, in the line ending screen (screenshot), keep the first option selected unless you know what you’re doing.  
56
57 ![](assets/images/git-3-crlf.png)
58
59 ### Installing the dependencies in MinGW
60
61 Xonotic requires a few more packages in MinGW that are not provided by default. Installing them is quite simple, just open a MinGW Shell and type the following line:
62
63     mingw-get install msys-wget msys-unzip mingw32-libiconv mingw32-libintl msys-libopenssl
64
65 You can paste text in the shell by right-clicking the title bar and selecting *Edit* \> *Paste*. But be careful with this, mistakes can happen!
66
67 To close a MinGW Shell, just type
68
69     exit
70
71 But keep this one open, we’re going to use it some more.
72
73 Step 2: downloading the Xonotic source files
74 --------------------------------------------
75
76 In this step, we will clone the Xonotic git repositories inside MinGW’s install directory.
77
78 In your MinGW Shell, type
79
80     git clone git://git.xonotic.org/xonotic/xonotic.git
81
82 This will clone the base repository, which contains a script called “`all`” that will manage the subrepositories. I will call this script `./all` to avoid confusion, as this is how we will be using it in the terminal.
83
84 Next, type
85
86     cd xonotic
87     ./all update -l best
88
89 The `cd` line tells the Shell to go inside the `xonotic` directory, where `./all` is located. In the second line, the `-l best` part asks `./all` to pick the best available mirror. This step will download several gigabytes of data, so expect it to take a while.
90
91 Step 3: compiling
92 -----------------
93
94 Compiling the game is quite simple. In your MinGW Shell, just type
95
96     ./all compile
97
98 This will compile gmqcc (which is a compiler for the QuakeC language), then the game code using gmqcc, then the DarkPlaces engine.
99
100 This step can take a few minutes, so be patient! When it’s over, check the last few lines to see if it reports any errors.
101
102 Step 4: running the game!
103 -------------------------
104
105 To run the game, you have to use `./all` again:
106
107     ./all run
108
109 If you ever need to start the game in windowed mode, you can launch it this way:
110
111     ./all run +vid_fullscreen 0
112
113 By default, `./all` uses the SDL build (called `xonotic.exe` in releases). You can use the WGL build (`xonotic-wgl.exe`) like this:
114
115     ./all run wgl
116
117 You will always need to use `./all` to launch the game. Do not forget that you need to be in the `xonotic` directory when you use the `./all` command. That means you have to type
118
119     cd xonotic
120
121 when you start a MinGW Shell before updating, compiling, or running Xonotic.
122
123 Keeping up to date
124 ------------------
125
126 To keep up to date, all you need to do is repeat some of the steps above. More precisely, here is what you will usually type in a new MinGW Shell to update Xonotic to the latest git revision:
127
128     cd xonotic
129     ./all update
130     ./all compile
131
132 You can optionally use this as the third line if the compilation does not work:
133
134     ./all compile -c
135
136 This will remove the partially compiled files from the previous compiles. It has been known to resolve some errors before, but it can take a little longer to recompile everything.
137
138 Getting help
139 ------------
140
141 You can always ask for help in the [Xonotic forums](http://forums.xonotic.org), under the Help and Support section.