{"id":13155,"date":"2017-03-06T15:38:26","date_gmt":"2017-03-06T22:38:26","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=13155"},"modified":"2022-08-11T18:38:49","modified_gmt":"2022-08-11T18:38:49","slug":"finding-the-visual-c-compiler-tools-in-visual-studio-2017","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/finding-the-visual-c-compiler-tools-in-visual-studio-2017\/","title":{"rendered":"Finding installed Visual C++ tools for Visual Studio 2017"},"content":{"rendered":"<p><div class=\"alert alert-info\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Content outdated<\/strong><\/p> For up-to-date documentation see <a class=\"Hyperlink SCXW225573484 BCX8\" href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/install\/tools-for-managing-visual-studio-instances?view=vs-2022\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW225573484 BCX8\" lang=\"EN-GB\" xml:lang=\"EN-GB\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW225573484 BCX8\" data-ccp-charstyle=\"Hyperlink\">Tools for detecting and managing Visual Studio instances<\/span><\/span><\/a>.<\/div>There have been a number of questions from customers about how to locate the tools in the world of this new installation model. \u00a0The following blog post will share a number of options available for locating Visual Studio 2017 instances and provides various samples that illustrates the process in action.<\/p>\n<h3><strong>How to find installed Visual Studio 2017 instances and C++ tools<\/strong><\/h3>\n<p>There are multiple ways you can go about the finding the VS instances installed and determining the tools installed for each instance.<\/p>\n<p>1. \u00a0<a href=\"https:\/\/github.com\/Microsoft\/vswhere\">vswhere.exe<\/a>:\u00a0 \u00a0A stand-alone native executable that is redistributable and can be used to locate installed Visual Studio product instances for use in build and deployment scripts. \u00a0The tool\u00a0supports emitting different formats so far including plain text, JSON, and XML.\u00a0 For example, the following batch script for vswhere will find the root path the latest installed version that also contains the C++ Desktop workload:<\/p>\n<pre class=\"scroll\" style=\"padding-left: 30px;\"><code class=\"cplusplus\">for \/f \"usebackq tokens=1* delims=: \" %%i in (`vswhere.exe -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop`) do (\r\n\r\nif \/i \"%%i\"==\"installationPath\" set dir=%%j\r\n\r\n)<\/code><\/pre>\n<p><em>%dir%<\/em> now contains the root installation path, if available.<\/p>\n<p>2. \u00a0<a href=\"https:\/\/blogs.msdn.microsoft.com\/heaths\/2017\/01\/25\/visual-studio-setup-powershell-module-available\/\">PowerShell API<\/a>: This is the simplest API for finding VS installation instances and components, but of course requires PowerShell v3 and above.\u00a0 If you are running on PowerShell v3 or v4, you will need to also install\u00a0<a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=746217\">PowerShellGet<\/a>. \u00a0This is already included in PowerShell v5 that comes with Windows 10.\u00a0 The following command will list all installed VS2017 instances that also installed the v141 toolset for x86 and x64:<\/p>\n<p>First install the VSSetup module:<\/p>\n<pre class=\"scroll\" style=\"padding-left: 30px;\"><code class=\"cplusplus\">Install-Module VSSetup -Scope CurrentUser<\/code><\/pre>\n<p>After that is completed, the following script will list all installed instances with Visual C++ compilers installed:<\/p>\n<pre class=\"scroll\" style=\"padding-left: 30px;\"><code class=\"cplusplus\">Get-VSSetupInstance | Select-VSSetupInstance -Latest -Require Microsoft.VisualStudio.Component.VC.Tools.x86.x64<\/code><\/pre>\n<p>3. \u00a0<a href=\"https:\/\/blogs.msdn.microsoft.com\/heaths\/2016\/09\/15\/changes-to-visual-studio-15-setup\/\">Visual Studio Setup API<\/a>: This COM API allows for querying installed VS instances and their components from a variety of programming languages (C++, C#, VB).\u00a0 The code is not as simple as the PowerShell script, but we have multiple examples on GitHub of how to consume the API:<\/p>\n<p><a href=\"https:\/\/github.com\/Microsoft\/vs-setup-samples\">Samples on GitHub<\/a> (<a href=\"https:\/\/github.com\/mluparu\/vs-setup-samples\/blob\/master\/Setup.Configuration.VC.NoDeps\/Program.cpp\">Sample with no NuGet dependency<\/a>)<\/p>\n<p><strong>Example: Finding instances with an installed Visual C++ toolset with the API<\/strong><\/p>\n<p>For a more specific example of using this COM API from C++ to list installed instances that include Visual C++ tools, <a href=\"https:\/\/github.com\/adamwelch\/vs-setup-samples\/tree\/findVCtools\">check out this sample on GitHub<\/a>.<\/p>\n<p>It is inside <em>PrintPackageReference<\/em> function that my sample checks the name of each installed component in the instance to determine if the Visual C++ toolset is installed (i.e. if \u201cMicrosoft.VisualStudio.Component.VC.Tools.x86.x64\u201d is installed).<\/p>\n<pre class=\"scroll\" style=\"padding-left: 30px;\"><code class=\"cplusplus\">\/\/check if instance has VC tools\r\nif (bstrId == L\"Microsoft.VisualStudio.Component.VC.Tools.x86.x64\") {\r\nvcToolsFound = true;\r\nstd::wcout &lt;&lt; L\"Instance \" &lt;&lt; OLE2T(vcInstance) &lt;&lt; \" contains the VC++ 2017 compiler tools (x86 and x64 targets).\\n\";\r\n}\r\n<\/code><\/pre>\n<p>If you build the solution, a simple command prompt will launch that can list installed Visual Studio instances, their components, and which instances have C++ tools installed.\u00a0 To find the VC++ build tools on the machine with the tool, select option #3 in and it will indicate which instance have VC++ tools installed:<a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?attachment_id=13165\"><img decoding=\"async\" class=\"alignnone size-full wp-image-13165\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/19.png\" alt=\"1\" width=\"645\" height=\"271\" \/><\/a><\/p>\n<p>Note:\u00a0 This sample is not an official tool and is meant simply to instruct how to leverage the COM API to locate the installed Visual C++ tools.<\/p>\n<h3><strong>\u00a0C++ installation workloads and components<\/strong><\/h3>\n<p>Below is a table of the underlying names used to describe each C++ workload, as well as the underlying component names used by the installer for the options provided in each workload. \u00a0The\u00a0 Visual C++ 2017 v141 compiler toolset component (x86 and x64 targeting), known as\u00a0<strong>Microsoft.VisualStudio.Component.VC.Tools.x86.x64<\/strong>, comes included in the desktop workload as a recommended (pre-selected) component and is a required (always installed) component in the C++ game and build tools workloads.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"272\"><strong>Workload<\/strong><\/td>\n<td width=\"303\"><strong>Installation Name<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"272\">Desktop development with C++<\/td>\n<td width=\"303\">Microsoft.VisualStudio.Workload.NativeDesktop<\/td>\n<\/tr>\n<tr>\n<td width=\"274\">Universal Windows Platform development<\/td>\n<td width=\"301\">Microsoft.VisualStudio.Workload.Universal<\/td>\n<\/tr>\n<tr>\n<td width=\"272\">Linux development with C++<\/td>\n<td width=\"310\">Microsoft.VisualStudio.Workload.NativeCrossPlat<\/td>\n<\/tr>\n<tr>\n<td width=\"272\">Game development with C++<\/td>\n<td width=\"303\">Microsoft.VisualStudio.Workload.NativeGame<\/td>\n<\/tr>\n<tr>\n<td width=\"272\">Mobile development with C++<\/td>\n<td width=\"303\">Microsoft.VisualStudio.Workload.NativeMobile<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\nBuild Tools Workloads<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"147\">MSBuild tools<\/td>\n<td width=\"297\">Microsoft.VisualStudio.Workload.MSBuildTools<\/td>\n<\/tr>\n<tr>\n<td width=\"148\">Visual C++ build tools<\/td>\n<td width=\"289\">Microsoft.VisualStudio.Workload.VCTools<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><strong>Desktop development with C++<\/strong><\/h4>\n<p><a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?attachment_id=13176\"><img decoding=\"async\" class=\"alignnone size-large wp-image-13176\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/desktop.png\" alt=\"desktop\" width=\"232\" height=\"370\" \/><\/a><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"222\"><strong>Friendly Name<\/strong><\/td>\n<td width=\"401\"><strong>Component Name<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"222\">VC++ 2017 v141 toolset (x86, x64)<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.Tools.x86.x64<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">C++ profiling tools<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.DiagnosticTools<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Windows 10 SDK (10.0.14393.0)<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.Windows10SDK.14393<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Visual C++ tools for CMake<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.CMake.Project<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Visual C++ ATL support<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.ATL<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Windows 8.1 SDK And UCRT SDK<\/td>\n<td width=\"401\">Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Windows XP support for C++<\/td>\n<td width=\"401\">Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">MFC and ATL support (x86 and x64)<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.ATLMFC<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">C++\/CLI support<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.CLI.Support<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Clang\/C2 (experimental)<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.ClangC2<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Standard Library Modules<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.Modules.x86.x64<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">IncrediBuild<\/td>\n<td width=\"401\">Component.Incredibuild<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Windows 10 SDK (10.0.10586.0)<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.Windows10SDK.10586<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Windows 10 SDK (10.0.10240.0)<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.Windows10SDK.10240<\/td>\n<\/tr>\n<tr>\n<td width=\"222\">Visual C++ 2015.3 v140 toolset (x86, x64)<\/td>\n<td width=\"401\">Microsoft.VisualStudio.Component.VC.140<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><strong>Universal Windows Platform development<\/strong><\/h4>\n<p><img decoding=\"async\" class=\"alignnone size-large wp-image-13205\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/uwp.png\" alt=\"uwp\" width=\"261\" height=\"277\" \/><\/p>\n<p>*<em>C++ Universal Windows Platform development tools<\/em> are required to be installed for C++ UWP development but are <u>not<\/u> installed by default.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"188\"><strong>Friendly Name<\/strong><\/td>\n<td width=\"434\"><strong>Component Name<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"188\">IntelliTrace<\/td>\n<td width=\"434\">Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd<\/td>\n<\/tr>\n<tr>\n<td width=\"188\">Graphics debugger and GPU profiler for DirectX<\/td>\n<td width=\"434\">Microsoft.VisualStudio.Component.Graphics.Tools<\/td>\n<\/tr>\n<tr>\n<td width=\"188\">*C++ Universal Windows Platform development tools<\/td>\n<td width=\"434\">*Microsoft.VisualStudio.ComponentGroup.UWP.VC<\/td>\n<\/tr>\n<tr>\n<td width=\"188\">Windows 10 SDK (10.0.10240.0)<\/td>\n<td width=\"434\">Microsoft.VisualStudio.Component.Windows10SDK.10240<\/td>\n<\/tr>\n<tr>\n<td width=\"188\">Windows 10 SDK (10.0.10586.0)<\/td>\n<td width=\"434\">Microsoft.VisualStudio.Component.Windows10SDK.10586<\/td>\n<\/tr>\n<tr>\n<td width=\"188\">Architecture and analysis tools<\/td>\n<td width=\"434\">Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Managed<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><strong>Game development with C++<\/strong><\/h4>\n<p><img decoding=\"async\" class=\"alignnone size-large wp-image-13185\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/game.png\" alt=\"game\" width=\"213\" height=\"275\" \/><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"212\"><strong>Friendly Name<\/strong><\/td>\n<td width=\"394\"><strong>Component Name<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"212\">C++ profiling tools<\/td>\n<td width=\"394\">Microsoft.VisualStudio.Component.VC.DiagnosticTools<\/td>\n<\/tr>\n<tr>\n<td width=\"212\">Windows 10 SDK (10.0.14393.0)<\/td>\n<td width=\"394\">Microsoft.VisualStudio.Component.Windows10SDK.14393<\/td>\n<\/tr>\n<tr>\n<td width=\"212\">Windows 10 SDK (10.0.10586.0)<\/td>\n<td width=\"394\">Microsoft.VisualStudio.Component.Windows10SDK.10586<\/td>\n<\/tr>\n<tr>\n<td width=\"212\">Windows 10 SDK (10.0.10240.0)<\/td>\n<td width=\"394\">Microsoft.VisualStudio.Component.Windows10SDK.10240<\/td>\n<\/tr>\n<tr>\n<td width=\"212\">Windows 8.1 SDK And UCRT SDK<\/td>\n<td width=\"394\">Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81<\/td>\n<\/tr>\n<tr>\n<td width=\"212\">IncrediBuild<\/td>\n<td width=\"394\">Component.Incredibuild<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><strong>Mobile development with C++<\/strong><\/h4>\n<p><a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?attachment_id=13195\"><img decoding=\"async\" class=\"alignnone size-large wp-image-13195\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/mobile.png\" alt=\"mobile\" width=\"247\" height=\"388\" \/><\/a><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"259\"><strong>Friendly Name<\/strong><\/td>\n<td width=\"232\"><strong>Component Name<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android NDK (RI 3B)<\/td>\n<td width=\"232\">Component.Android.NDK.R13B<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Apache Ant (1.9.3)<\/td>\n<td width=\"232\">Component.Ant<\/td>\n<\/tr>\n<tr>\n<td width=\"261\">Android SDK setup (API level 19 and 21)<\/td>\n<td width=\"230\">Component.Android.SDK19<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android SDK setup (API level 22)<\/td>\n<td width=\"232\">Component.Android.SDK22<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android SDK setup (API level 23)<\/td>\n<td width=\"232\">Component.Android.SDK23<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Java SE Development Kit (8.0920.14)<\/td>\n<td width=\"232\">Component.JavaJDK<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">C++ Android development tools<\/td>\n<td width=\"232\">Component.MDD.Android<\/td>\n<\/tr>\n<tr>\n<td width=\"260\">Google Android Emulator (API Level 23)<\/td>\n<td width=\"231\">Component.Android.Emulator<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Intel Hardware Accelerated Execution<\/td>\n<td width=\"232\">Component.HAXM<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android NDK (RI 3B) (32bit)<\/td>\n<td width=\"238\">Component.Android.NDK.R13B_3264<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android NDK (R12B)<\/td>\n<td width=\"232\">Component.Android.NDK.R12B<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android NDK (R12B) (32bit)<\/td>\n<td width=\"238\">Component.Android.NDK.R12B_3264<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android NDK (R11C)<\/td>\n<td width=\"232\">Component.Android.NDK.R11C<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">Android NDK (R11C) (32bit)<\/td>\n<td width=\"238\">Component.Android.NDK.R11C_3264<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">C++ iOS development tools<\/td>\n<td width=\"232\">Component.MDD.IOS<\/td>\n<\/tr>\n<tr>\n<td width=\"259\">IncrediBuild<\/td>\n<td width=\"232\">Component.Incredibuild<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><strong>Visual C++ build tools<\/strong><\/h4>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-13166\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/bt.png\" alt=\"bt\" width=\"229\" height=\"295\" \/><\/p>\n<p><em>*The Visual C++ Build tools <u>always<\/u> installs the VS2017 v141 toolset.<\/em><\/p>\n<table width=\"629\">\n<tbody>\n<tr>\n<td width=\"233\"><strong>Friendly Name<\/strong><\/td>\n<td width=\"396\"><strong>Component Name<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"233\">*VC++ 2017 v141 toolset (x86, x64)<\/td>\n<td width=\"396\">\u00a0Microsoft.VisualStudio.Component.VC.Tools.x86.x64<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Windows 10 SDK (10.0.14393.0)<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.Windows10SDK.14393<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Visual C++ tools for CMake<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.VC.CMake.Project<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Windows 8.1 SDK And UCRT SDK<\/td>\n<td width=\"396\">Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Visual C++ ATL support<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.VC.ATL<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">MFC and ATL support (x86 and x64)<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.VC.ATLMFC<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">C++\/CLI support<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.VC.CLI.Support<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Clang\/C2 (experimental)<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.VC.ClangC2<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Standard Library Modules<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.VC.Modules.x86.x64<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Windows 10 SDK (10.0.10586.0)<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.Windows10SDK.10586<\/td>\n<\/tr>\n<tr>\n<td width=\"233\">Windows 10 SDK (10.0.10240.0)<\/td>\n<td width=\"396\">Microsoft.VisualStudio.Component.Windows10SDK.10240<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3><strong>Setting up your command-line environment<\/strong><\/h3>\n<p>The Developer Command prompt in Visual Studio 2017 can be used to set the path to the VC++ toolset in the <em>VCToolsInstallDir<\/em> environment variable.\u00a0 Now that we found have the path for each of the installed VS2017 instances that have VC++ compiler tools installed, we will refer to this directory as <strong>&lt;VSInstanceDir&gt;<\/strong>.\u00a0 This script is in the following location:<\/p>\n<p>&lt;VsInstanceDir&gt;\\Common7\\Tools\\vsdevcmd.bat [-arch=&lt;tgt_arch&gt;] [-host_arch=&lt;host_arch&gt;]<\/p>\n<p><strong>&lt;tgt_arch&gt;<\/strong> is the architecture upon which the produced binary will run (x86 [default], x64, arm).<\/p>\n<p><strong>&lt;host_arch&gt;<\/strong> is the architecture for which the compiler\/linker was built (i.e. do you want cl.exe\/link.exe, itself, to be able to make use of 32-bit or 64-bit address space) (x86 [default], x64).<\/p>\n<p>Here is an example that will set up the command-line build environment to use the host-x64 compiler targeting x64, the following command would be used:<\/p>\n<p>&lt;VsInstanceDir&gt;\\Common7\\Tools\\vsdevcmd.bat -arch=x64 -host_arch=x64<\/p>\n<p>We have now configured our command-line build environment so that it knows where the correct VC++ tools are based on our preferences(host\/target).<\/p>\n<h3><strong>Identifying the VC++ compiler tools version<\/strong><\/h3>\n<p>In a world where multiple version of VC++ tools could be installed in a single VS instance, we have introduced the concept of <strong>&lt;VCToolsVersion&gt;<\/strong> which indicates the default version of VC++ tools for that VS installation instance.\u00a0 If you plan to manually assemble path to the VC++ toolset directory, we need to know the default version of the installed tools to get the full path.<\/p>\n<p>The &lt;VCToolsVersion&gt; is found in one of two files that can be located once you have a &lt;VSInstanceDir&gt;.<\/p>\n<p><em>&lt;VsInstanceDir&gt;\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.[txt|props]<\/em><\/p>\n<p>You can check out the batch script located <em>&lt;VsInstanceDir&gt;\\Common7\\Tools\\vsdevcmd\\ext\\vcvars.bat<\/em> as an example of how the VS Developer Command Prompt does this.<\/p>\n<p>Once a &lt;VCToolsVersion&gt; value is identified, the full VC++ tools path can be manually constructed as follows:<\/p>\n<p><em>&lt;VsInstanceDir&gt;\\VC\\Tools\\MSVC\\&lt;VCToolsVersion&gt;\\bin\\Host&lt;host_arch&gt;\\&lt;tgt_arch&gt;<\/em><\/p>\n<p>For our installed tools for host-x64 and target-x64, the path looks like:<\/p>\n<p><em>&lt;VSInstanceDir&gt;\\VC\\ToolsMSVC\\14.10.24930\\bin\\HostX64\\x64<\/em><\/p>\n<h3><strong>Closing remarks<\/strong><\/h3>\n<p>Since we have removed the VS150COMNTOOLS registry key to support the new world where multiple VS instances of the same product can be installed side-by-side on the same machine, we know that many build systems and tools have relied on this in the past and the new options are not an identical replacement.\u00a0 We are actively working with library developers and others with builds that depend on the VC++ compiler tools, and we are open to further feedback to help refine and improve upon the solutions mentioned above.\u00a0 Please share any feedback you have in the comments or feel free to send more detailed suggestions to <a href=\"mailto:visualc@microsoft.com\">visualc@microsoft.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There have been a number of questions from customers about how to locate the tools in the world of this new installation model. \u00a0The following blog post will share a number of options available for locating Visual Studio 2017 instances and provides various samples that illustrates the process in action. How to find installed Visual [&hellip;]<\/p>\n","protected":false},"author":295,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13155","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>There have been a number of questions from customers about how to locate the tools in the world of this new installation model. \u00a0The following blog post will share a number of options available for locating Visual Studio 2017 instances and provides various samples that illustrates the process in action. How to find installed Visual [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/13155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/295"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=13155"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/13155\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=13155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=13155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=13155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}