There are plenty of tutorials online on how to install clang on windows with visual studioIDE and MinGW. However, there are none on clang with visual studio build tools.
- 64-bit Windows 7 SP1 or newer with the latest updates installed
- 6 GB of free space on the partition where Windows is installed
- internet connection (for installation only)
%VS2017BuildToolsDir%
= installation directory of VS 2017 build tools
- download and run the microsoft visual studio build tools
- select and install the following individual component(s):
- Static analysis tools
- VC++ 2015.3 v140 toolset for desktop (x86,x64)
- VC++ 2017 v141 toolset (x86,x64)
- Visual C++ Build Tools core features
- Windows Universal C Runtime
- if windows 10:
- Windows 10 SDK (10.0.10240.0)
- if windows 7 / 8 / 8.1
- Windows Universal CRT SDK
- Windows 8.1 SDK
- Start > Visual Studio 2017 > Developer Command Prompt for VS 2017 (run as administrator)
- execute command(s):
cd %VS2017BuildToolsDir%\Common7\Tools\
VsMSBuildCmd
- download and run LLVM
- add to PATH for current/all user(s)
- run visual studio installer
- remove the following individual component(s):
- VC++ 2015.3 v140 toolset for desktop (x86,x64)
%procdir%
= directory where you created proc.c
- create proc.c with
#include <stdio.h>
int main(void) {
printf("Test\n");
while(1) {}
return 0;
}
- Start > Windows System > Command Prompt (run as administrator)
- execute command(s):
cd %ProcDir%
clang -std=c89 proc.c -o proc.exe
proc.exe
'clang' is not recognized as an internal or external command, operable program or batch file.
You didn't select the set PATH for current/all user(s). If you did but it still didn't work, set the path environment variable manually by adding %LLVMInstallLocation%\bin
clang.exe: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
You didn't install VC++ 2015.3 v140 toolset for desktop (x86,x64) and/or VC++ 2017 v141 toolset and/or run VsMSBuildCmd
Apparently this link works:
https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=buildtools