This page describes the steps necessary to build ReactOS.
ReactOS supports building on different operating systems and with different compilers. Currently GCC, MSVC and LLVM/Clang can be used.
The build process differs depending your operating system and the compiler of choice.
Each build step in the tutorial is separated by OS/compiler when necessary. Choose ones which fit your configuration.
- 1 Which compiler to use
- 2 Prerequisites
- 3 TL;DR
- 4 Building instructions
- 4.1 1. Prepare a command prompt
- 4.2 2. Obtain the source code
- 4.3 3. Do the "configure" step
- 4.4 4. Start the build
- 5 See also
Which compiler to use
- GCC is currently a recommended option as the most simple to use.
- MSVC compiler can be used for better debugging capabilities (only MSVC builds support windbg debugger).
- Clang support is currently experimental and not advised unless you know what are you doing.
- A PC with at least 2GB of RAM (4GB preferred), 15GB of free space.
- Git version control system.
- ReactOS Build Environment (RosBE). Please, always use the latest version available.
- (optional) Microsoft Visual Studio 2015 or later (or Build Tools for Visual Studio).
- (optional) LLVM toolchain 12.0.0 or later.
- Download the Visual studio 2017 community edition (or later).
- When selecting the options, be sure to at least include Desktop development with C++.
- Ensure you have started visual studio at least once, and you are able to create a working c++ project.
- To validate this, choose Create a new project, choose Console App, and use all default options.
- While installing RosBE, you may choose the option Add BIN folder to PATH variable (may be added later manually).
Notice: It is recommended to disable antivirus software before proceeding (or adding a build folder to exceptions), because some AVs may detect ReactOS' system files (in particular, crtdll.dll or csrss.exe) as being infected.
<inside RosBE command prompt> git clone https://github.com/reactos/reactos cd reactos configure.cmd cd output-MinGW-i386 ninja bootcd livecd
1. Prepare a command prompt
Windows/GCC or ReactOS/GCC
- Just use the RosBE command prompt (from the Start menu)
clangis available in
- Open a Visual Studio command prompt for a desired target architecture (x86 or amd64).
- Add RosBE's
PATH(if you have not done that during the RosBE installation), like this:
- Set the
set M4=C:\RosBE\Bin\m4.exe set BISON_PKGDATADIR=C:\RosBE\share\bison
C:\RosBE is an example path of RosBE. You may choose a different one.
- Same as MSVC, but also ensure that
clang-cl.exeand other LLVM tools are added to
2. Obtain the source code
git clone https://github.com/reactos/reactos.git
3. Do the "configure" step
Before building the output location must be created and prepared. This is an easy step and involves only one command. This command is located in the root of recent revisions of the source code and can be run either from the root directory itself or any other directory you want the build your sources in. Please make sure you are running it from within a prepared build environment (step 1).
Windows or ReactOS
configure.cmd [CMake generator] [Additional CMake options]
CMake generator is one of the following:
Ninja (default)use Ninja as a CMake backend
VSSolutionuse MSBuild/sln file as a CMake backend (for working with the source code inside Visual Studio)
configure.sh [Additional CMake options]
Additional CMake command line options may be passed in this format:
ARCHtarget architecture. Either "i386" (default), "amd64" or "arm".
SARCHarchitecture flavor. For i386 "pc" (default), "pc98" or "xbox" values are supported
ENABLE_ROSTESTSinclude tests in the build. Either "0" (default) or "1".
ENABLE_ROSAPPSinclude extra utilities in the build. Either "0" (default) or "1".
PCHenable precompiled headers to increase the build speed. NOTE: may consume 7-15GB more space. Defaults to "1" for MSVC and "0" for GCC.
USE_CLANG_CLuse clang-cl compiler instead of cl (only on Windows). Either "0" (default) or "1".
NO_REACTOS_BUILDNOdo not include commit hash and date in the image. This allows to avoid recompiling the image when date changes. Either "0" (default) or "1".
So to configure an MSVC build with ninja and rosapps and rostests, you would use:
configure.cmd -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1
4. Start the build
This step depends on what has been chosen as a CMake generator.
From the build folder (e.g. reactos\output-MinGW-i386) enter the following command:
Available targets are:
bootcdcreates an installation ISO to install ReactOS on a VM or PC.
livecdcreates a live CD ISO to try ReactOS without installing.
allbuilds all binaries of ReactOS. ISO files are not created though.
cleancleans all files of your working copy except the generated ISO files (if any).
- Any other binary file ReactOS consists of, for example
VSSolution (Visual Studio)
Warning: Visual Studio (VSSolution) build cannot currently produce a bootable ISOs so use it for working with individual user-mode apps (like notepad, rapps or paint). For building bootcd or livecd configuration, please use Ninja option.
For this example we are going to see how to build rapps from Visual Studio 2019.
- If configure step went well, this message should appear:
Configure script complete! You can now use msbuild or open REACTOS.sln.
- There should now be a REACTOS.sln in your build folder (Which contains ALL projects!)
- Since rapps has the cmake [
project(rapps)] macro, there will also be a smaller solution just for rapps at
- Open this solution, and expand
- Right click rapps, choose Set as Startup Project
- Press Debug->Start Debugging in the menu, or the hotkey that is displayed behind it (usually F5)