⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
Windows

On Windows, DuckDB requires the Microsoft Visual C++ Redistributable package both as a build-time and runtime dependency. Note that unlike the build process on UNIX-like systems, the Windows builds directly call CMake.

Clang-cl

To build DuckDB on Windows, we recommend using the clang-cl compiler with the Visual Studio build tools (MSVC toolchain, Windows SDK and linker). This is the setup used by DuckDB's CI workflow.

  1. Install Visual Studio (or the Build Tools for Visual Studio) with the “Desktop development with C++” workload and the “C++ Clang Compiler for Windows” component. You also need Python, CMake, Ninja and a Bash shell with GNU Make (e.g., Git Bash with make installed).
  2. Open a shell where the Visual Studio environment variables are set (e.g., the “x64 Native Tools Command Prompt” or a shell started from it).
  3. Run the following commands in a Bash shell from the root of the DuckDB repository:

    export GEN=ninja
    export CC=clang-cl
    export CXX=clang-cl
    python scripts/windows_ci.py
    make windows_release
    

The make windows_release target invokes CMake with the bundled extensions configuration (.github/config/bundled_extensions.cmake) and builds DuckDB in Release mode.

MSYS2 and MinGW64

DuckDB on Windows can also be built with MSYS2 and MinGW64. Note that this build is only supported for compatibility reasons and should only be used if the clang-cl build is not feasible on a given platform. To build DuckDB with MinGW64, install the required dependencies using Pacman. When prompted with Enter a selection (default=all), select the default option by pressing Enter.

pacman -Syu git mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
git clone https://github.com/duckdb/duckdb
cd duckdb
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DBUILD_EXTENSIONS="icu;parquet;json"
cmake --build . --config Release

Once the build finishes successfully, you can find the duckdb.exe binary in the repository's directory:

./duckdb.exe

Building the Go Client

Building on Windows may result in the following error:

go build
collect2.exe: error: ld returned 5 exit status

GitHub user vdmitriyev shared instructions for building the DuckDB Go client on Windows:

  1. Get four files (.dll, .lib, .hpp, .h) from the libduckdb-windows-amd64.zip archive.

  2. Place them to, e.g.,: C:\duckdb-go\libs\.

  3. Install the dependencies following the duckdb-go project.

  4. Build your project using the following instructions:

    set PATH=C:\duckdb-go\libs\;%PATH%
    set CGO_CFLAGS=-IC:\duckdb-go\libs\
    set CGO_LDFLAGS=-LC:\duckdb-go\libs\ -lduckdb
    go build
    
© 2026 DuckDB Foundation, Amsterdam NL
DuckDB Home Code of Conduct Trademark Use Blog