> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/dolphin-emu/dolphin/llms.txt
> Use this file to discover all available pages before exploring further.

# Building on Windows

> Complete guide to building Dolphin Emulator on Windows with Visual Studio

Building Dolphin on Windows uses Visual Studio solution files rather than CMake. This guide covers the complete process.

## Prerequisites

### Required Software

* **Visual Studio 2022** (17.2.3 or later) or **Build Tools for Visual Studio**
* **Git for Windows**
* **Windows SDK** (latest version)

<Note>
  Dolphin targets the latest MSVC shipped with Visual Studio or Build Tools. Other compilers might work but are not tested or recommended.
</Note>

### Compiler Requirements

* **MSVC**: Version 19.32 or later (Visual Studio 2022 17.2.3+)
* **C++ Standard**: C++23 support required

## Step-by-Step Build Instructions

<Steps>
  ### Clone the Repository

  Clone the Dolphin repository from GitHub:

  ```powershell theme={null}
  git clone https://github.com/dolphin-emu/dolphin.git
  cd dolphin
  ```

  ### Initialize Submodules

  Dolphin requires Git submodules to be initialized before building:

  ```powershell theme={null}
  git submodule update --init --recursive
  ```

  <Warning>
    Skipping this step will cause build failures.
  </Warning>

  ### Open the Solution File

  Open the Visual Studio solution file located at:

  ```
  Source/dolphin-emu.sln
  ```

  You can open it by:

  * Double-clicking the file in File Explorer
  * Using **File > Open > Project/Solution** in Visual Studio
  * Running from command line: `start Source/dolphin-emu.sln`

  ### Select Build Configuration

  Visual Studio provides two main build configurations:

  #### Release Configuration

  * Includes performance optimizations
  * Best for normal use and testing
  * Provides the best user experience
  * Makes debugging more difficult

  #### Debug Configuration

  * Significantly slower execution
  * More verbose output
  * Less permissive (catches more errors)
  * Easier to debug with breakpoints and inspectors

  <Note>
    Select the desired configuration from the dropdown menu in the Visual Studio toolbar.
  </Note>

  ### Select Target Architecture

  Choose the appropriate architecture for your system:

  * **x64**: For 64-bit Intel/AMD processors (most common)
  * **ARM64**: For ARM64 Windows devices

  ### Build Dolphin

  Build the solution using one of these methods:

  <CodeGroup>
    ```text Visual Studio theme={null}
    Build > Build Solution (or press Ctrl+Shift+B)
    ```

    ```powershell MSBuild Command Line theme={null}
    msbuild Source/dolphin-emu.sln /p:Configuration=Release /p:Platform=x64 /m
    ```
  </CodeGroup>

  ### Locate Output Files

  After a successful build, binaries are located in:

  * **x64 builds**: `Binary/x64/`
  * **ARM64 builds**: `Binary/ARM64/`

  The main executable is `Dolphin.exe`.
</Steps>

## Advanced Build Options

### Command-Line Builds

You can build from the command line using MSBuild:

```powershell theme={null}
# Build Release configuration for x64
msbuild Source/dolphin-emu.sln /p:Configuration=Release /p:Platform=x64 /m

# Build Debug configuration for x64
msbuild Source/dolphin-emu.sln /p:Configuration=Debug /p:Platform=x64 /m

# Build for ARM64
msbuild Source/dolphin-emu.sln /p:Configuration=Release /p:Platform=ARM64 /m
```

The `/m` flag enables parallel compilation for faster builds.

### Clean Builds

To perform a clean build (remove all previous build artifacts):

<CodeGroup>
  ```text Visual Studio theme={null}
  Build > Clean Solution
  Then: Build > Build Solution
  ```

  ```powershell MSBuild theme={null}
  msbuild Source/dolphin-emu.sln /t:Clean /p:Configuration=Release /p:Platform=x64
  msbuild Source/dolphin-emu.sln /p:Configuration=Release /p:Platform=x64 /m
  ```
</CodeGroup>

### Building Specific Projects

To build only specific components:

1. Right-click the project in **Solution Explorer**
2. Select **Build**

Common projects:

* **Dolphin**: Main Qt GUI application
* **DolphinNoGUI**: Command-line variant
* **DolphinTool**: CLI utility for disc image management

## Architecture Support

### x64 (x86-64)

* Most common architecture
* Full feature support
* Best performance and compatibility

### ARM64

* For Windows on ARM devices
* Surface Pro X, ARM-based laptops
* OpenGL backend not available on Windows ARM64

## Compiler Flags and Options

Dolphin's Windows build uses the following MSVC options:

### Optimization Flags

* `/Gy` - Enable function-level linking
* `/Oi` - Generate intrinsic functions
* `/GS-` - Disable buffer security checks (Release only)
* `/Zc:inline` - Remove unreferenced inline functions/data
* `/OPT:REF /OPT:ICF` - Eliminate dead code and data (linker)

### Standards Compliance

* `/std:c++23` - C++23 standard
* `/Zc:__cplusplus,enumTypes,externConstexpr,preprocessor,templateScope,throwingNew` - Strict conformance
* `/volatile:iso` - ISO C++ volatile semantics
* `/fp:precise` - Precise floating-point model

### Code Quality

* `/W4` - Warning level 4 (highest)
* `/WX` - Treat warnings as errors
* `/GR-` - Disable RTTI
* `/EHsc` - Exception handling model

## Troubleshooting

### Missing Windows SDK

**Error**: Cannot find Windows SDK

**Solution**: Install the latest Windows SDK through Visual Studio Installer:

1. Open Visual Studio Installer
2. Click **Modify** on your Visual Studio installation
3. Under **Individual Components**, select the latest Windows SDK
4. Click **Modify** to install

### Submodules Not Initialized

**Error**: Missing header files or libraries from Externals

**Solution**: Initialize submodules:

```powershell theme={null}
git submodule update --init --recursive
```

### Build Errors After Git Pull

**Solution**: Perform a clean build:

1. Close Visual Studio
2. Delete the `Binary/` directory
3. Run `git submodule update --init --recursive`
4. Reopen the solution and build

### Out of Memory During Build

**Solution**: Reduce parallel compilation:

* In Visual Studio: **Tools > Options > Projects and Solutions > Build and Run**
* Set **Maximum number of parallel project builds** to a lower value (e.g., 2-4)

### Linker Errors

**Error**: LNK errors about missing symbols

**Solution**:

1. Ensure submodules are initialized
2. Try a clean build
3. Verify you're using a supported MSVC version (19.32+)

## Next Steps

After building:

* The executable is in `Binary/x64/` or `Binary/ARM64/`
* Copy the `Data/Sys` folder to `Binary/x64/Sys` if it's not already present
* Run `Dolphin.exe` to start the emulator

<Note>
  For development builds, Visual Studio will automatically copy necessary files to the output directory.
</Note>
