Try out the latest C + + compiler toolset without waiting for the next update of Visual Studio

Source: Internet
Author: User

Updated 22/apr/2016:the NuGet Package was now being uploaded daily. The payload doesn ' t change every day is should see new bug fixes and/or feature updates every five days or so. Look for a blog post on this topic soon!

Last November we announced a prerelease of the Visual C + + Build Tools, a standalone C + + installer for Build environments. We asked feedback on the experience and truly appreciate the great response we got in blog comments and through OT Her channels. We ll be updating the VC + + Build Tools soon and would incorporate some of your suggestions with the update.

Some of suggested that the VC + + Build Tools don ' t go far enough toward creating a lightweight the go-to acquire the VC + + Tools. Some folks asked for a install that works through Xcopy. Others suggested we use a package manager, or even just a zip file. What's clear from all your feedback are that many of your just want an easy-to-try out the latest compiler inside Visual Studio.

Today we ' re announcing a new experiment:releasing the VC + + toolset as a NuGet package that can is added to any C + + Projec T or solution targeting desktop. Installing this NuGet package lays down a new copy of the VC compiler, header files, and libraries. You can compile your code with this preview toolset and, once you ' re do checking out the new tools, can just Uninsta ll the package and get back to the supported toolset installed with Visual Studio.

Why might do you want-to-try out new tools? There ' s a lot of change happening in Visual C + + Today:support for new features going into the C + + language such as Cor Outines, support for proposed features such as C + + Modules, and daily bug fixes for standards conformance. You shouldn ' t has to wait for the next VS Update if you ' re tracking we progress on new language features or has been WA Iting for a conformance fix. Installing a NuGet package is the quickest-to test a new compiler.

The experience we ' re offering through NuGet today is pretty limited:it's just one big (226 MB) NuGet package that install s in a project or a solution. We ' ve got ideas the experience better:machine-wide install, for example, or allowing you to select just One host or target architecture. We ' re publishing the packages manually right now and would consider automating so we can do nightly updates if that would be useful for C + + developers.

The NuGet package would install a compiler, headers, and libraries that override the current VS version but your project WI ll continue to pick up the other libraries from your VS install. This package doesn ' t include special-purpose libraries like ATL or Mfc–those is only available through VS right now. And if you need a new version of the Windows libraries or Universal CRT with a To install a new Windows development K It.

We ' d like a you-to-try out of the NuGet installer and send us feedback on where you ' d like us to head with the project. You can leave comments on the blog, or send mail to us directly at [email protected] This was a prerelease project so we CA N ' t officially support it, but we ' re happy to help out where possible.

Installing the Preview VC + + toolset in a C + + Project or solution

For those of familiar with using NuGet in Visual Studio, the server is located Here:http://vcppdogfooding.azu Rewebsites.net/nuget. There ' s only one package at the moment so just browse the feed and you ' re sure to find it.

If you need a further detailed walkthrough, read on. Right now you can only install the NuGet package locally in a project or solution. Just Right-click on the project or solution and select Manage NuGet Packages.

Because these packages aren ' t located on nuget.org you'll have the to set up a new package Source. Click on the gear icon in the top right of the dialog:

This would bring up the Options dialog open to package Sources. Click on the + button to add a new package. Once you ' ve do this, you'll have to edit the Name and Source on the bottom of the dialog. Enter any name of the sure that is http://vcppdogfooding.azurewebsites.net/nuget/. Hitting the OK button would close the dialog and bring to the NuGet Package Manager.

Select your new package Source at the top of the dialog and click on the Browse tab. Make sure to click the Include prerel Ease checkbox or won ' t see anything. Once The Package Manager connects to the server, you should see a package called Visualcpptools. Select it and click the Install button on the right. Click through the next few dialogs (making sure to carefully review the license on the second dialog) and your NuGet packa GE would install.

When you rebuild your project or solution you'll be using the preview C + + toolset. Nothing else would have changed in the developer Experience-intellisense, source browsing, debugging should all be the same . You ' re just using new compilers and libraries. When you want to go back to the officially supported toolset that came with Visual Studio, just go back to the NuGet Packa GE Manager dialog and select the Installed tab. There you are able to uninstall the preview toolset entirely.

Installing the Preview VC + + toolset with the VC + Build Tools SKU

Is you using the VC + + Build Tools SKU? It's a little more work-for-you-try out of the preview toolset but it's easily done. Here's how you can do it.

First, you need to get the NuGet command-line tool. Both the download link and documentation is at this link:https://docs.nuget.org/consume/command-line-reference. When you run Nuget.exe you'll need to supply a source parameter pointing to the server and the-prerelease switch on any C Ommands.

Here's the command to install the "Preview toolset" (command shown in blue with output in black):

 c:\tmp>nuget Install Visualcpptools-source http://vcppdogfooding.azurewebsites.net/nuget/-prereleasefeeds Used:http://vcppdogfooding.azurewebsites.net/nuget/attempting to gather dependencies information for package ' Visualcpptools.14.0.23811-pre ' With respect to project ' C:\tmp ', targeting ' any,version=v0.0 ' attempting to resolve Dependencies ' Visualcpptools.14.0.23811-pre ' with Dependencybehavior ' Lowest ' Resolving actions to install Package ' Visualcpptools.14.0.23811-pre ' resolved actions to the install package ' Visualcpptools.14.0.23811-pre ' Adding Package ' Visualcpptools.14.0.23811-pre ' to Folder ' C:\tmp ' Added package ' visualcpptools.14.0.23811-pre ' to folder ' C + TMP ' successfully installed ' Visualcpptools 14.0.23811-pre ' to C:\tmp ' 

Lastly, if you ' re using the Visual C + + Build Tools Command prompts, you'll have a to-edit them to the the preview ' s INS Tall directory. The easiest-to-do-is-to-edit the file that you'll find in the vcbuildtools.bat same directory as the Build Tools Command Pro MPTs. On the My system, they ' re at \Program Files (x86)\Microsoft Visual C++ Build Tools . If your Build Tools is installed there as well you'll need to run your editor with Administrator privileges (e.g., search For Notepad, right click, and select Run as Administrator.)

There's a lot of fancy command script in this batch file but you have need to add one line. It overrides the VCInstallDir environment variable after the script pulls it out of the registry. Here's the top of my file, customized to my install directory c:\tmp of, with the line I added in blue:

@echo Offset Curdir=%~dp0@call:getwindowssdkdir@call:getwindowssdkexecutablepath32@call: Getwindowssdkexecutablepath64@call:getextensionsdkdir@call:getvcinstalldir@call:getuniversalcrtsdkdirset Vcinstalldir=c:\tmp\visualcpptools.14.0.23811-pre\lib\nativeif not "%universalcrtsdkdir%" = "" "@set UCRTContentRoot =%universalcrtsdkdir%if not exist "%~dp0. \msbuild\microsoft.cpp\v4.0\v140\ "goto ERROR_NO_VCTARGETSCD"%~dp0. \msbuild\microsoft.cpp\v4.0\v140\ "Set VCTARGETSPATH=%CD%CD%curdir%

Note so you can ' t just override on the VCInstallDir command line because the script builds other environment variables on top O F VCInstallDir . And yes, it would is more efficient to stop setting the VCInstallDir environment variable when we ' re just going to Overri De it, but I'll leave that as a exercise for the reader.

After you ' ve installed the package and edited your  Vcbuildtools.bat , running any of the Build Tools C Ommand prompts should result in the preview toolset being invoked. You can verify this easily by running  CL-BV  to Show the version of the compiler and the location F Rom where it is running:

C:\Program Files (x86) \microsoft Visual C + + Build Tools>cl-bvmicrosoft (R) C + + optimizing Compiler Version 19.00.238 One for X86copyright (C) Microsoft Corporation.  All rights reserved. Compiler passes:c:\tmp\visualcpptools.14.0.23811-pre\lib\native\bin\cl.exe:        Version 19.00.23811.0 C:\tmp\ Visualcpptools.14.0.23811-pre\lib\native\bin\c1.dll:        Version 19.00.23811.0 C:\tmp\ Visualcpptools.14.0.23811-pre\lib\native\bin\c1xx.dll:      Version 19.00.23811.0 C:\tmp\ Visualcpptools.14.0.23811-pre\lib\native\bin\c2.dll:        Version 19.00.23811.0 C:\tmp\ Visualcpptools.14.0.23811-pre\lib\native\bin\link.exe:      Version 14.00.23811.0 C:\tmp\ Visualcpptools.14.0.23811-pre\lib\native\bin\mspdb140.dll:  Version 14.00.23811.0 C:\tmp\ Visualcpptools.14.0.23811-pre\lib\native\bin\1033\clui.dll:version 19.00.23811.0cl:command line Error D8003: Missing source filename
In closing

Please try out the tools and let us know what do you think! We ' re excited about where the this project could go but we can ' t does it without your ideas and suggestions on how to would use VC + + Tools delivered through NuGet in your work or project.

Http://www.cnblogs.com/roucheng/p/cpptimu.html

Try out the latest C + + compiler toolset without waiting for the next update of Visual Studio

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.