DEV Community

Cover image for How to Install the New Version of Clang/LLVM on Windows
Marcos Oliveira
Marcos Oliveira

Posted on

1

How to Install the New Version of Clang/LLVM on Windows

We already made this post about installing Clang, but it became obsolete. In this quick article, we’ll see how to do it easily.


Installation

If you installed the version from the other article

First, remove the directory and also the path from the environment variable.

Open PowerShell as administrator.

Remove the installation:

Remove-Item -Path "C:\Users\$env:USERNAME\.utils" -Recurse -Force
Enter fullscreen mode Exit fullscreen mode

Remove the environment variable:

[Environment]::SetEnvironmentVariable("Path", (
    ($env:Path -split ";") -ne "C:\Users\Marcos\.utils\llvm-mingw\bin" -join ";"
), [System.EnvironmentVariableTarget]::Machine)
Enter fullscreen mode Exit fullscreen mode

Installing Clang/LLVM MinGW

This version does not depend on MSVC.

Just use WinGet:

winget install --id=MartinStorsjo.LLVM-MinGW.UCRT  -e
Enter fullscreen mode Exit fullscreen mode

Still with admin rights, run this command:

[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\LLVM\bin", "Machine")
Enter fullscreen mode Exit fullscreen mode

Close the terminal, reopen it and check the version:

clang++ --version
Enter fullscreen mode Exit fullscreen mode

There is also the MSVC version, but to have both installed you need to rename one of the paths and add it to PATH, just use the WinGet command for it:

winget install --id=LLVM.LLVM  -e
Enter fullscreen mode Exit fullscreen mode

If you had conflicts, uninstall with: winget uninstall --id=LLVM.LLVM


Difference Between Versions

--id=LLVM.LLVM

Official Microsoft and LLVM version.

  • Installs the official LLVM distributed by the LLVM Foundation.
  • Includes tools like:

    • clang, clang++ (C/C++ compilers)
    • lld (linker)
    • lldb (debugger)
    • clang-format, clang-tidy, etc.

Main uses:

  • Modern C/C++ development on Windows, Linux, or macOS.
  • Replacing MSVC (Visual C++) in cross-platform projects.
  • When you want to compile for native Windows with Clang + MSVC.

By default, it uses the Visual Studio (MSVC) toolchain as backend on Windows (for linking, runtime, etc).


--id=MartinStorsjo.LLVM-MinGW.UCRT

  • Installs the LLVM-MinGW distribution, maintained by Martin Storsjö.
  • Uses Clang + MinGW linker + runtime (no Visual Studio dependency).
  • Based on the UCRT (Universal C Runtime), making executables more modern and compatible.

Main uses:

  • Compile Windows apps using LLVM without needing Visual Studio.
  • Produce binaries completely free of MSVC dependencies.
  • Ideal for cross-platform development, CI/CD automation, and cross-compilation (e.g., compiling Windows from Linux).

Includes:

  • clang, lld, libc++, libunwind, MinGW headers/libraries (with UCRT)
  • Pre-configured tools to compile directly for Windows

Quick Comparison:

Feature LLVM.LLVM (Official) LLVM-MinGW.UCRT (Martin Storsjö)
Maintained by LLVM Foundation Martin Storsjö
Default backend on Windows MSVC (Visual Studio) MinGW + UCRT
Requires Visual Studio? Yes (for linking, by default) No
Main target Windows (with MSVC) Windows (without MSVC)
Typical use IDEs like VSCode with Clang Cross-compiling, portable builds
License Permissive (LLVM) Permissive (LLVM + MinGW UCRT)

  • If you already use Visual Studio or want MSVC ecosystem integration: Use LLVM.LLVM.
  • If you want a complete, MSVC-independent toolchain (especially useful for scripts, CI/CD, or cross-compilation): Use MartinStorsjo.LLVM-MinGW.UCRT.

See also:

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Explore this insightful write-up, celebrated by our thriving DEV Community. Developers everywhere are invited to contribute and elevate our shared expertise.

A simple "thank you" can brighten someone’s day—leave your appreciation in the comments!

On DEV, knowledge-sharing fuels our progress and strengthens our community ties. Found this useful? A quick thank you to the author makes all the difference.

Okay