Difference between revisions of "Visual Studio"

From ReactOS Wiki
Jump to: navigation, search
m (declared as stub)
m (Build RApps in VS 2019 CE)
Line 1: Line 1:
{{Stub}}
+
'''Before reporting problems, ensure you have followed every step!'''
We need to create a separate article about '''Building ReactOS''' in '''Visual Studio'''.
 
It is about to have low entry barrier. The current article mixes RosBE and VS, this thing confuses people.
 
  
 +
For this example we are going to see how to build [https://github.com/reactos/reactos/tree/master/base/applications/rapps rapps] from Visual Studio 2019.
  
 +
=== Installation ===
 +
# Download the Visual studio 2019 community edition.
 +
#* When selecting the options, be sure to at least include '''''<tt>Desktop development with C++</tt>'''''
 +
#*: [[File:Desktop development.png|Desktop development]]
 +
# Ensure you have started visual studio at least once, and you are able to create a working c++ project.
 +
#* To validate this, choose '''''<tt>Create a new project</tt>''''', choose '''''<tt>Console App</tt>''''', and use all default options
 +
# Install the latest [[RosBE]] (Preferrably in '''''<tt>C:\RosBE\</tt>''''')
 +
#* Tick the option '''''<tt>Add BIN folder to PATH variable</tt>''''' (If you do not want this, you can later add it manually)
 +
#*: [[File:RosBE BIN folder.png]]
 +
# Get the source
 +
#* See for example [[ReactOS_Git_For_Dummies#Cloning_the_repository]]
  
  
==Visual Studio Command Prompt==
+
=== Creating the Solution ===
wtf is Visual Studio Command Prompt? Newbies do not know this
+
 
 +
# Open the '''''<tt>x86 Native Tools Command Prompt for VS 2019 Community Edition</tt>'''''
 +
#: [[File:x86 Native Tools Command Prompt for VS 2019.png]]
 +
# If you did not add the '''''<tt>BIN</tt>''''' folder to the PATH during RosBE setup, add it now manually:
 +
#* <pre>set PATH=C:\RosBE\Bin;%PATH%</pre>
 +
# Create a folder where you want your solution to be created, and navigate towards that:
 +
#* <pre>pushd r:\build\wip\devenv_2019</pre>
 +
# Validate that RosBE is correctly setup:
 +
#* <pre>where cmake</pre>
 +
#* The first entry should be: '''''<tt>C:\RosBE\bin\cmake.exe</tt>'''''
 +
# Generate the solution (the source directory is '''''<tt>R:\src\wip</tt>''''' for this example):
 +
#* <pre>R:\src\wip\configure.cmd VSSolution -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1</pre>
 +
#** The switch '''''<tt>-DENABLE_ROSTESTS=1</tt>''''' enables the testsuite
 +
#** The switch '''''<tt>-DENABLE_ROSAPPS=1</tt>''''' enables extra applications to be included that are also present on a release
 +
# If all went well, the message '''''<tt>Configure script complete! You can now use msbuild or open REACTOS.sln.</tt>''''' appears.
 +
#* There should now be a REACTOS.sln in '''''<tt>R:\build\wip\devenv_2019</tt>''''' (Which contains ALL projects!)
 +
#* Since rapps has the cmake [[https://git.reactos.org/?p=reactos.git&a=search&h=HEAD&st=grep&s=project%28rapps%29 '''''<tt>project(rapps)</tt>''''']] macro, there will also be a smaller solution just for rapps: '''''<tt>R:\build\wip\devenv_2019\base\applications\rapps\rapps.sln</tt>'''''
 +
#* Open this solution, and expand '''''<tt>base\rapplications\rapps</tt>'''''
 +
#* Right click rapps, choose '''''<tt>Set as Startup Project</tt>'''''
 +
#*: [[File:Set as Startup Project.png]]
 +
#* Press '''''<tt>Debug->Start Debugging</tt>''''' in the menu, or the hotkey that is displayed behind it (F5 for me)
 +
#* '''''Have fun!'''''
 +
#*: [[File:RApps in Win10.png|RApps running in Windows 10]]

Revision as of 16:07, 16 May 2020

Before reporting problems, ensure you have followed every step!

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

Installation

  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
  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 setup:
    • where cmake
    • The first entry should be: C:\RosBE\bin\cmake.exe
  5. 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
  6. 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)
    • Have fun!
      RApps running in Windows 10