Developing ReactOS with Visual Studio

From ReactOS Wiki
Jump to: navigation, search

Before reporting problems, ensure you have followed every step!

This workflow is mainly for working on usermode applications.

For this example we are going to see how to build rapps from Visual Studio 2019.

If you have already installed RosBE and Visual Studio, skip to Creating the Solution


  1. Download the Visual Studio 2019 community edition.
    • When selecting the options, be sure to at least include Desktop development with C++
      Desktop development
  2. 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
  3. Install the latest RosBE (Preferrably in C:\RosBE\)
    • Tick the option Add BIN folder to PATH variable (If you do not want this, you can later add it manually)
      RosBE BIN folder.png
  4. Get the source

Creating the Solution

  1. Open the x86 Native Tools Command Prompt for VS 2019 Community Edition
    X86 Native Tools Command Prompt for VS 2019.png
    • x64_x86 Cross Tools Command Prompt should work too
  2. If you did not add the BIN folder to the PATH during RosBE setup, add it now manually:
    • set PATH=C:\RosBE\Bin;%PATH%
  3. Create a folder where you want your solution to be created, and navigate towards that:
    • pushd r:\build\wip\devenv_2019
  4. Validate that RosBE is correctly set up:
    • cmake --version
    • The result should be: cmake version 3.17.1-ReactOS
  5. Ensure that BISON and M4 are correctly configured:
    • set M4
    • The output should be: M4=C:\RosBE\Bin\m4.exe and BISON_PKGDATADIR=C:\RosBE\share\bison
    • set BISON_PKGDATADIR=C:\RosBE\share\bison
      set M4=C:\RosBE\Bin\m4.exe
  6. Generate the solution (the source directory is R:\src\wip for this example):
    • R:\src\wip\configure.cmd VSSolution -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1
      • The switch -DENABLE_ROSTESTS=1 enables the testsuite
      • The switch -DENABLE_ROSAPPS=1 enables extra applications to be included that are also present on a release
  7. If all went well, the message Configure script complete! You can now use msbuild or open REACTOS.sln. appears.
    • There should now be a REACTOS.sln in R:\build\wip\devenv_2019 (Which contains ALL projects!)
    • Since rapps has the cmake [project(rapps)] macro, there will also be a smaller solution just for rapps: R:\build\wip\devenv_2019\base\applications\rapps\rapps.sln
    • Open this solution, and expand base\rapplications\rapps
    • Right click rapps, choose Set as Startup Project
      Set as Startup Project.png
    • Press Debug->Start Debugging in the menu, or the hotkey that is displayed behind it (F5 for me)
  8. Have fun!
    RApps running in Windows 10