



On Linux, Visual Studio by default uses the first Clang location that it finds in the PATH environment property. Choose Clang for Remote Linux if you're using a remote machine or VM. Under General > Platform Toolset, choose Clang for Windows Subsystem for Linux if you're using Windows Subsystem for Linux (WSL).Typically, you should first choose All configurations at the top of the dialog.Right-click on the project node in Solution Explorer and choose Properties.To configure a Visual Studio Linux project to use Clang: The project properties and nearly all compiler flags are identical Configure a Linux project to use Clang toolsįor Linux projects, Visual Studio uses the Clang GCC-compatible frontend. For more information, see Set a custom LLVM location. If you're using a custom Clang installation, you can either modify Project > Properties > VC++ Directories > Configuration Properties > Executable Directories by adding the custom Clang installation root as the first directory there, or change the value of the LLVMInstallDir property. By default, clang-cl.exe is located in %VCINSTALLDIR%\Tools\Llvm\bin\ and %VCINSTALLDIR%\Tools\Llvm\圆4\bin\. It links with the Microsoft implementation of the Standard Library. For Windows projects, Visual Studio by default invokes Clang in clang-cl mode. If you're using the Clang tools that are bundled with Visual Studio, no extra steps are required. Then, under General > Platform Toolset, choose LLVM (clang-cl) and then OK. Typically, you should first choose All configurations at the top of the dialog. To configure a Visual Studio project to use Clang, right-click on the project node in Solution Explorer and choose Properties. Configure a Windows project to use Clang tools For example, Visual Studio 2019 version 16.9 includes Clang v11. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library. Later versions of Visual Studio provide newer versions of the Clang toolset. The Microsoft C++ Standard Library requires at least Clang 8.0.0. You may prefer to use an existing Clang installation on your machine if so, choose C++ Clang-cl for v142 build tools. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing C++ Clang tools for Windows under Desktop development with C++ optional components. Installįor best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. You can use Visual Studio 2019 version 16.2 and later with Clang to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
