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

发布时间:2026-01-25 12:34

为什么数学老师最喜欢听哪首歌?‘99 Bottles of Beer on the Wall’,因为每瓶啤酒都会让她多出一个方程式。 #生活乐趣# #幽默笑话#

Cover image for 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:

How to Install the New Version of GCC MinGW on Windows How to Use Tmxlite for Game Maps (Windows and Linux)

Hosting.com image

Your next WordPress project? Deployed for $1.

This Black Friday, hosting.com powered by Rocket.net gives you fully Managed WordPress Hosting for just $1 in your first month.
No setup headaches. No caching chaos. Just pure speed with Cloudflare Enterprise CDN, advanced security, and automatic updates.

Whether it is a side project or your next client build, you will be live in minutes. Grab the $1 deal and start building.

Learn more

网址:How to Install the New Version of Clang/LLVM on Windows https://klqsh.com/news/view/327982

相关内容

How to Install Clang on Windows
How can I install clang
How run clang from command line on Windows?
Installing Clang on Mac
Ways to install Windows 11
How to Change the Taskbar Color on Windows 11
Clang C/C++ Download and Installation Instructions
How to Install a VPN on Kindle Fire
How to Install PyInstaller — PyInstaller 6.15.0 documentation
How to Open APK Files? Try These 4 On

随便看看