User:Cinefast/Compiling

From SRB2 Wiki
Jump to navigation Jump to search

Many people would like to attempt to compile SRB2s source code, for instance to make a modification. There are several ways of doing so. Thankfully, all are very easy.

Compiling on Windows

If you're on Windows, you have the highest selection of tools to compile with.

GNU Make

This is the most standard way of compiling SRB2. GNU Make is a command line tool that automates the compiling process of software.

First, you need to download TDM-GCC. TDM-GCC is a compiler suite for Windows. It features the latest gcc, binutils, and other tools like gdb, a debugger. You can obtain it from here (simply download and run the Bundle Installer).

Now that you have TDM-GCC, it's time to get the required libraries and headers. Download it from here and set the extraction folder to where you installed TDM-GCC (Probably C:/MinGW).

After this is extracted, compiling is simple. Simply use the command line (this assumes you understand how; if not, please google it) to get into the folder where you extracted SRB2's source code, then do cd src. Now do mingw32-make MINGW=1 and you will have a compiled EXE and the r_opengl.dll in the bin/MinGW/Release folder. If this does not work, please contact Alam, Logan, or Cinefast in SRB2Fun.

Visual C++

Visual C++ is Microsoft's C/C++ compiler and IDE (a tool that allows an easy and integrated development of software).

Download Visual C++ 2010 Express first from here. Visual C++ Express is a free version of Visual C++ and is ideal for SRB2.

You can then get the required libraries and headers. You need FMOD 3.75 and the DirectX SDK. If you have no luck finding these, please ask in SRB2Fun.

Simply open the project file and press a little green arrow in the toolbar, and the compiled EXE and r_opengl.dll will be placed in bin/MSVC/Release or bin/MSVC/Debug. If this failed, please contact Alam, Cue, or Cinefast in SRB2Fun.