Documentation Index
Fetch the complete documentation index at: https://mintlify.com/freerdp/freerdp/llms.txt
Use this file to discover all available pages before exploring further.
MSVC (native)
MinGW cross-compile
Requirements
- Visual Studio 2019 or later (any edition, including Build Tools)
- CMake >= 3.13
- Ninja (bundled with Visual Studio, or install separately)
- A pre-built OpenSSL distribution for Windows (e.g. from Shining Light or vcpkg)
Opening a developer prompt
All CMake commands must be run inside a Visual Studio Developer Command Prompt, or from a standard cmd/PowerShell session that has already sourced vcvarsall.bat:"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
Clone the repository
git clone https://github.com/FreeRDP/FreeRDP.git C:\freerdp\src
Configure with CMake
cmake -GNinja ^
-DCMAKE_BUILD_TYPE=Release ^
-DWITH_VERBOSE_WINPR_ASSERT=OFF ^
-DCMAKE_INSTALL_PREFIX=C:\freerdp\install ^
-B C:\freerdp\build ^
-S C:\freerdp\src
Compile and install
cmake --build C:\freerdp\build --target install
CI preload configuration
The repository ships ci/cmake-preloads/config-windows.txt with recommended Windows settings:set(CMAKE_WINDOWS_VERSION "WIN7" CACHE STRING "windows build version")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "build static linked executable")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "MSVC runtime to use")
set(OPENSSL_USE_STATIC_LIBS ON CACHE BOOL "link OpenSSL static")
set(WITH_SERVER ON CACHE BOOL "build with server")
set(WITH_CLIENT_SDL ON CACHE BOOL "build with SDL client")
set(CHANNEL_URBDRC OFF CACHE BOOL "USB redirection")
Apply it with:cmake -C C:\freerdp\src\ci\cmake-preloads\config-windows.txt ^
-GNinja ^
-B C:\freerdp\build ^
-S C:\freerdp\src
cmake --build C:\freerdp\build
Notable Windows flags
| Flag | Description |
|---|
BUILD_SHARED_LIBS=OFF | Produce a statically linked executable. |
OPENSSL_USE_STATIC_LIBS=ON | Link OpenSSL statically. |
CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded | Use the static MSVC runtime (/MT). |
WITH_WIN_CONSOLE=ON | Attach a console window to the client executable. |
WITH_SHADOW=OFF | Disable the shadow server (not supported on Windows). |
WITH_CLIENT_SDL=ON | Build the SDL2 client. |
WITH_SDL_LINK_SHARED=OFF | Link SDL2 statically. |
ZLIB_USE_STATIC_LIBS=ON | Link zlib statically. |
Overview
FreeRDP can be cross-compiled for Windows from a Linux host using llvm-mingw, which supports both msvcrt and ucrt runtimes.MinGW builds are not actively maintained. The build may occasionally break. Pull requests to maintain MinGW support are welcome.
A maintained sample build script is located at scripts/mingw.sh in the repository and is periodically exercised by the CI workflow at .github/workflows/mingw.yml.A complete Docker-based build example for LLVM-MinGW is provided at docs/mingw-example/ in the repository.Docker-based example build
The docs/mingw-example/ directory contains a Dockerfile and helper scripts that build all dependencies (zlib, OpenSSL, OpenH264, libusb, FAAC, FAAD2) and FreeRDP itself inside a Docker container.Build for x86_64
cd docs/mingw-example
./build_x64.sh
Build for ARM64
cd docs/mingw-example
./build_arm64.sh
Build for x86 (32-bit)
cd docs/mingw-example
./build_ia32.sh
Each script sets TARGET_ARCH and calls _build.sh, which runs docker compose up to produce the Windows binaries.Manual cross-compile with llvm-mingw
Configure with the toolchain file
A CMake toolchain file for each target triple is expected at docs/mingw-example/toolchain/cmake/<arch>-w64-mingw32-toolchain.cmake.cmake -GNinja \
-DCMAKE_TOOLCHAIN_FILE=docs/mingw-example/toolchain/cmake/x86_64-w64-mingw32-toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=/build \
-DWITH_X11=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-B build -S .
Build
cmake --build build -j $(nproc)
cmake --install build