Source code compiling

From SRB2 Wiki
Jump to: navigation, search
Warning icon.png This article or section is badly written and in need of a rewrite. You can help the SRB2 Wiki by fixing this article to meet with the standards described by the Manual of Style.
ToDoIcon.png To do
Overhaul this article and related subarticles – see the talk page

Welcome to the source code compiling tutorial. This tutorial teaches you how to compile SRB2's source code to create an executable you can launch. The compiling process is necessary for creating custom source code modifications or creating builds from the GitHub development repositories. This tutorial won't teach you how to modify the source code, it will only explain the process of compiling for several platforms.

Build systems

There are three main build systems used for compiling SRB2:

Makefiles (Windows/Linux)

Main article: Makefiles

This is the current method of compilation internally. For Windows, MinGW is required for compiling using Makefiles.

Visual C++ (Windows)

Visual C++ (MSVC) is Microsoft's C/C++ compiler. It is included in Microsoft's IDE, Visual Studio. While there exist projects for compiling SRB2 with MSVC, Windows builds compiled with Visual Studio versions older than 2015 cannot play multiplayer games with GCC builds due to differences in each compiler's struct packing schemes. As such, it is usually advised to use MinGW instead as the official builds are compiled under GCC.

Download Visual Studio 2017 Community Edition first from here. Visual Studio 2017 Community Edition is a free version of Visual Studio and is ideal for SRB2.

Simply open the project file and press a little green arrow in the toolbar, and the compiled EXE and r_opengl.dll (if you didn't use SDL2) will be placed in bin/VC/Release or bin/VC/Debug. If this failed, please contact Alam in SRB2Fun.

CMake (Windows/Mac OS X/Linux)

Main article: CMake