DarkRadiant - Compiling in MinGW

From The DarkMod Wiki
Jump to navigationJump to search

Note

MinGW support is discontinued. This page stays merely as an archive.

Compiling in MinGW

You'll need to download these pieces of software (these are all free, you don't need to pay for anything):

  • TortoiseSVN for obtaining the sources
  • MinGW the actual compiler
  • ActivePython to run scons (other Python releases should work as well)
  • scons to run the compilation scripts

Step 1: Install the Tools

First, download and install TortoiseSVN. Nothing special here, just install it into any folder of your preference. After installation it probably will ask to reboot your machine, as Tortoise integrates into the Explorer shell. (You can do that later, when all the other components have been installed).

Second, install the compiler MinGW. Launch the setup and choose the package Current, then be sure to check the box of the g++ compiler. Choose Download and Install in the next steps and let setup do the rest.

Third, install the ActivePython interpreter, which is needed to run the SconScript. Nothing spectacular here as well. After Python has been installed, run the scons installer (version 0.96.1 and 0.97 work for sure, don't know about others). Reboot the machine, to make sure everything is properly set up.

Set the Path to the MinGW Compiler

If scons complains about gcc and g++ missing, you will have to add the path to the compiler to your PATH environment variable:

  • Press Win-Break or right-click on "My Computer" and choose "Properties". Go to advanced and seek the button for the Environment Variables. I'm not sure if it's called like this, because I'm running a German version of WinXP, but the Window should be something like this:

drenvironmenthh3.th.jpg

Look to the variable named "Path" in the lower part of the dialog and double click the property. A small window will pop-up containing the name and the value of the environment variable. You'll have to add the path to the MinGW\bin folder to the end of the long string:

;C:\MinGW\bin;

Be sure that a semicolon divides the newly added path from the previous ones, as I indicated above. A double semicolon won't hurt either, so if the above folder is matching to your installation, you can as well copy & paste it into that window. Close the dialogs by hitting OK, you're done with that. The next time you'll open a console the path should be functional. If not, please double-check your path for typos and/or post in the forums.

Step 2: Compile the Sources

If you're finished downloading the sources, open up the console by pressing Win-R or click Start > Run..., then type cmd and confirm. Once the DOS box is there, head to the according source folder by typing

cd C:\DarkRadiant

or whatever your path is where you downloaded them. Now type:

scons BUILD="release"

and the sources should start to compile (in release mode).

It's likely that I forgot something here and you might get scons complaining about a missing compiler or something. In that case, please tell greebo to update this tutorial accordingly.

The time neede to compile DarkRadiant strongly depends on your CPU power and may take up to ten minutes for a release build (a debug build may take much longer for whatever reasons).

Step 3: Run DarkRadiant

The readily compiled sources can be found in the install/ folder beneath the DarkRadiant root (the folder you downloaded your sources to).

C:\DarkRadiant\install\darkradiant.exe

Just create a shortcut by dragging the exe somewhere to your desktop with right mouse button and choose to create a link there. There is also an icon file located in the same folder you can use for this link to make it looking more pleasant.

If you get an error during startup, please contact greebo, perhaps there is something missing in this tutorial.