Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/joncampbell123/dosbox-x/llms.txt

Use this file to discover all available pages before exploring further.

DOSBox-X can be compiled from source on all major platforms. The build system supports both SDL 1.2 (included in-tree with heavy modifications) and SDL 2.x. In addition to pre-built releases and nightly development builds, building from source gives you full control over feature flags, SDL version, and target platform.
The SDL 1.x library shipped in-tree has been heavily modified from the upstream SDL 1.2 sources — it is not compatible with a stock SDL 1.2 installation. Always use the in-tree version for SDL1 builds.

Prerequisites

The build requires a C++ compiler capable of at least the C++11 standard (GCC, Clang, or MSVC 2017+). New contributions should target C++14 compatibility per the project coding guidelines.

Required (all platforms)

  • C++11-capable compiler minimum (GCC, Clang, MSVC 2017+)
  • SDL 1.2 (in-tree) or SDL 2.x
  • make, autoconf, automake
  • nasm (for x86 assembly cores)
  • pkg-config

Optional libraries

  • libpng — screenshot support
  • libfluidsynth — SoundFont/MIDI synthesis
  • libfreetype — TrueType font (TTF) output
  • libslirp / libpcap — NE2000 networking backends
  • ffmpeg libs — video capture support
  • ncurses / pdcurses — built-in debugger

Platform Build Instructions

Visual Studio 2017, 2019, and 2022 are all supported. The resulting executables target Windows Vista (32-bit or 64-bit) and higher.Steps:
1

Open the solution file

Open ./vs/dosbox-x.sln in Visual Studio 2017, 2019, or 2022.
2

Select platform and SDL version

Choose your target platform (Win32 or x64, ARM or ARM64) and select either the SDL1 or SDL2 build configuration from the Configuration Manager.
3

Set the platform toolset

The default toolset is v142 (VS 2019). Change to v141 (VS 2017) or v143 (VS 2022) to match your installed build tools.
VS 2017 requires you to explicitly set WindowsTargetPlatformVersion, for example 10.0.22000.0. ARM builds require SDK version 10.0.22621.0 or earlier.
4

Install the DirectX 2010 SDK (optional)

Direct3D 9 output support requires the DirectX SDK (June 2010). This is optional; other output modes work without it.
5

Build

Select Build → Build Solution. SDL, FreeType, libpng, zlib, pdcurses, and FluidSynth libraries are already bundled — no extra installation is needed.
Windows XP target:To produce an executable that runs on Windows XP, change the platform toolset to v141, build normally, then patch the PE header:
./contrib/windows/installer/PatchPE.exe path-to-your-exe-file/dosbox-x.exe
The slirp networking backend is only available in MinGW builds. Visual Studio builds do not support libslirp. Use the pcap backend or MinGW if you need slirp-based NE2000 networking.

Build Script Reference

The repository ships several convenience build scripts. All scripts invoke the configure step with preset flags appropriate for the target.
ScriptDescription
./buildStandard build
./build-debugDebug build with SDL1 (Linux/macOS)
./build-debug-sdl2Debug build with SDL2 (Linux/macOS)
./build-sdl2SDL2 release build
./build-mingwMinGW Windows 7+ SDL1 build
./build-mingw-sdl2MinGW Windows 7+ SDL2 build
./build-mingw-lowendMinGW XP-compatible SDL1 build
./build-mingw-lowend-sdl2MinGW XP-compatible SDL2 build
./build-mingw-lowend9xMinGW Windows 9x/NT4 SDL1 build
./build-mingw-hx-dosDOS with HX Extender (SDL1, 32-bit)
./build-macosmacOS SDL1 build
./build-macos-sdl2macOS SDL2 build
./build-macosoldmacOS Sierra and older (experimental)

Configure Script Options

The configure script accepts flags to enable or disable specific features. Pass them after the script name, for example:
./build-debug --enable-debug=heavy --disable-opengl
Key options include:
FlagEffect
--enable-sdlUse SDL 1.x
--enable-sdl2Use SDL 2.x
--enable-debug[=heavy]Enable the built-in debugger (use heavy for extra detail)
--enable-d3d9Enable Direct3D 9 output
--disable-openglDisable OpenGL output
--disable-avcodecDisable FFmpeg video capture
--disable-freetypeDisable TrueType font output
--disable-mt32Disable MT-32 emulation
--disable-dynamic-x86Disable the x86/x64 dynamic CPU core
--disable-dynrecDisable the recompiling CPU core
--disable-fpuDisable FPU emulation
--enable-hx-dosEnable HX-DOS target
Use ./configure --help inside the source tree for the full list of flags. To get verbose build output, run make V=1 after configuring.

Library Reference

LibraryRequiredPurpose
SDL 1.2 (in-tree)One of the two SDL optionsCore window/input/audio (modified)
SDL 2.x (in-tree)One of the two SDL optionsCore window/input/audio
zlib (in-tree)YesSave states, CHD support, libpng
libpng (in-tree, optional)NoScreenshots
FreeType (in-tree, optional)NoTTF output, printing
SDL_Net (in-tree, optional)NoModem/IPX networking
SDL_Sound (in-tree, optional)NoCompressed CD audio (MP3/OGG/FLAC)
ncurses / pdcursesNoBuilt-in debugger
FluidSynthNoSoundFont MIDI synthesis
libpcap / NpcapNoNE2000 pcap networking backend
libslirpNoNE2000 slirp networking backend
FFmpeg (avcodec etc.)NoVideo capture
ALSA headersNoALSA MIDI on Linux

Build docs developers (and LLMs) love