Install Clang on Windows 10 with MSYS2 MinGW-w64

preview_player
Показать описание
How to install Clang on Windows using the MSYS2 distro.

Second part of this video (Using Clang from Visual Studio Code):

If you prefer to install Clang with Visual Studio 2019, check this video:

Install commands used in the video:
pacman -Syu
pacman -S mingw-w64-x86_64-clang
pacman -S nano vim

Build command example for a C program:
clang -std=c17 -Wall -Wextra -pedantic test.c -o test

Build command example for a C++ program:
Рекомендации по теме
Комментарии
Автор

Nice video! There is also a vs-extension, it's called Clang Power Tools. It allows you to use Clang on Windows directly inside Visual Studio if you are a VS C++ user

ionutenache
Автор

Followed exactly, "-bash: clang: command not found"
maybe it's because it's a school computer :(

wsar
Автор

Why i need a compiler to use another compiler?

elchippe
Автор

The build command is not working for c++17 though it works for c++14. Any workaround?

cripz
Автор

i did clang--version
it says -bash: clang--version: command not found. i need technical support.

yusufdadkhah
Автор

clang++ -std=c++17 -Wall -Wextra -pedantic test.cpp -o test sad "no input files".

ghoicfw
Автор

the 3rd command doesn't work for me. it says error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
if you're sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck
what should i do?

yusufdadkhah
Автор

clang --version "bash: clang: command not found"

AlchemApps
Автор

it doesn't know what packman -syu
means, it says -bash: packman: command not found
you know the icon that goes to the location you set i clicked it and it told me there was a key missing and it said can't re write permissions and it listed directories so i can't re write the permissions i should with the software and i did packman -syu
on that as well and it says -bash: packman: command not found. i have got an idea of how to fix the keys, i probably need

help with the command. what solution do you have? i think make software called packman -syu
and put code inside that will make it do what it is suppose to do and make sure the terminial executes that application and proceed with the rest of the steps.

yusufdadkhah