Try out the latest C++ compiler toolset without waiting for the next update of Visual Studio
Updated 22/Apr/2016: The NuGet package is now being uploaded daily. The payload doesn’t change every day but you 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 you for feedback on the experience and truly appreciate the great response we got in blog comments and through other channels. We’ll be updating the VC++ Build Tools soon and will incorporate some of your suggestions with the update.
Some of you suggested that the VC++ Build Tools don’t go far enough toward creating a lightweight way to acquire the VC++ tools. Some folks asked for an 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 is that many of you just want an easy way 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 be added to any C++ project 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 done checking out the new tools, you can just uninstall the package and get back to the supported toolset installed with Visual Studio.
Why might 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++ 17 language such as Coroutines, support for proposed features such as C++ Modules, and daily bug fixes for standards conformance. You shouldn’t have to wait for the next VS Update if you’re tracking our progress on new language features or have been waiting for a conformance fix. Installing a NuGet package is the quickest way 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 installs in a project or a solution. We’ve got ideas about how to make 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 but would consider automating so we can do nightly updates if that would be useful for C++ developers.
The NuGet package will install a compiler, headers, and libraries that override the current VS version but your project will continue to pick up the other libraries from your VS install. This package doesn’t include special-purpose libraries like ATL or MFC–those are only available through VS right now. And if you need a new version of the Windows libraries or Universal CRT you’ll have to install a new Windows Development Kit.
We’d like you to try out 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 VCNuGetTools@microsoft.com. This is a prerelease project so we can’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 you who are familiar with using NuGet in Visual Studio, the server is located here: http://vcppdogfooding.azurewebsites.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 more 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 to set up a new Package Source. Click on the gear icon on the top right of the dialog:
This will bring up the Options dialog open to Package Sources. Click on the + button add a new package. Once you’ve done this, you’ll have to edit the Name and Source on the bottom of the dialog. Enter any name you like, but make sure the source is http://vcppdogfooding.azurewebsites.net/nuget/. Hitting the OK button will close the dialog and bring you back 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 prerelease checkbox or you 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 package will install.
When you rebuild your project or solution you’ll be using the preview C++ toolset. Nothing else will 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 Package Manager dialog and select the Installed tab. There you’ll be able to uninstall the preview toolset entirely.
Installing the Preview VC++ Toolset with the VC++ Build Tools SKU
Are you using the VC++ Build Tools SKU? It’s a little more work for you to try out 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 are 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 commands.
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/ -Prerelease
Feeds 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 for package 'VisualCppTools.14.0.23811-Pre' with DependencyBehavior 'Lowest'
Resolving actions to install package 'VisualCppTools.14.0.23811-Pre'
Resolved actions to 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 to edit them to point to the preview’s install directory. The easiest way to do this is to edit the file vcbuildtools.bat
that you’ll find in the same directory as the Build Tools Command Prompts. On my system, they’re at \Program Files (x86)\Microsoft Visual C++ Build Tools
. If your Build Tools are 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 that batch file but you only 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 of c:\tmp
, with the line I added in blue:
@echo off set curDir=%~dp0 @call :GetWindowsSdkDir
@call :GetWindowsSdkExecutablePath32
@call :GetWindowsSdkExecutablePath64
@call :GetExtensionSdkDir
@call :GetVCInstallDir
@call :GetUniversalCRTSdkDir
set VCInstallDir=C:\tmp\VisualCppTools.14.0.23811-Pre\lib\native\ if not "%UniversalCRTSdkDir%" == "" @set UCRTContentRoot=%UniversalCRTSdkDir%
if not exist "%~dp0..\MSBuild\Microsoft.Cpp\v4.0\v140\" goto error_no_VCTARGETS
cd "%~dp0..\MSBuild\Microsoft.Cpp\v4.0\v140\"
set VCTargetsPath=%cd%\
cd %curDir%
Note that you can’t just override VCInstallDir
on the command line because the script builds other environment variables on top ofVCInstallDir
. And yes, it would be more efficient to stop setting the VCInstallDir
environment variable when we’re just going to override it, but I’ll leave that as an exercise for the reader.
After you’ve installed the package and edited your vcbuildtools.bat
, running any of the Build Tools Command 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 from where it is running:
C:\Program Files (x86)\Microsoft Visual C++ Build Tools>cl -Bv
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23811 for x86
Copyright (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.0 cl : Command line error D8003 : missing source filename
In closing
Please try out the tools and let us know what you think! We’re excited about where this project could go but we can’t do it without your ideas and suggestions on how you 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的更多相关文章
- Solve: Your project references the latest version of Entity Framework (for MySQL) in Visual Studio 2013
The error message while trying to create a ADO.net Entity Data Model ( Entity Framework 6 ) for MySq ...
- windows ntp安装及调试
Setting up NTP on Windows It's very helpful that Meinberg have provided an installer for the highly- ...
- 微软宣布成立.NET基金会全面支持开源项目 包括C#编译器Roslyn【转】
基金会初始董事包括 Mono 项目和 Xamarin 的老大 Miguel de Icaza,微软 .NET 团队代表和微软开放技术公司(这是微软专门为开源和开放技术.标准化成立的独立公司)代表. 首 ...
- A chatroom for all! Part 1 - Introduction to Node.js(转发)
项目组用到了 Node.js,发现下面这篇文章不错.转发一下.原文地址:<原文>. ------------------------------------------- A chatro ...
- Visual Studio开发Cordova应用示例
作者:Grey 原文地址:http://www.cnblogs.com/greyzeng/p/5455728.html 本文的GIF动画均使用ScreenToGif进行录制. Cordova是什么? ...
- CaptureManagerSDK
Simple SDK for capturing, recording and streaming video and audio from web-cams on Windows OS by Win ...
- [转]Cordova + Ionic in Visual Studio - 101 Tutorial [Part I]
本文转自:http://binarylies.ghost.io/cordova-ionic-in-visual-studio/ Hi everyone, I thought about lending ...
- [转]Getting Start With Node.JS Tools For Visual Studio
本文转自:http://www.c-sharpcorner.com/UploadFile/g_arora/getting-started-with-node-js-tools-for-visual-s ...
- Download the WDK, WinDbg, and associated tools
Download the WDK, WinDbg, and associated tools This is where you get your Windows Driver Kit (WDK) a ...
随机推荐
- 软件包管理 之 RPM 基础 《RPM 的介绍和应用》
RPM 是 Red Hat Package Manager 的缩写,本意是Red Hat 软件包管理,顾名思义是Red Hat 贡献出来的软件包管理:在Fedora .Redhat.Mandriva. ...
- android中自定义view---实现竖直方向的文字功能,文字方向朝上,同时提供接口,判断当前touch的是哪个字符,并改变颜色
android自定义view,实现竖直方向的文字功能,文字方向朝上,同时提供接口,判断当前touch的是哪个字符,并改变颜色. 由于时间比较仓促,因此没有对代码进行过多的优化,功能远远不如androi ...
- Excel的一些常用设置
1. Freeze表头 (1) 下拉Worksheet的Pane,让该sheet有2个工作区,将该pane下拉到某一特定的行. (2)Window->Freeze Panes.此时会将pane智 ...
- saiku 展示优化第二步(要诀和技巧)
经历了上几篇博客的分享,可以无密码登录 : http://www.cnblogs.com/liqiu/p/5246015.html 随着使用的深入,公司需要将现有的报表平台与saiku整合,其中最便捷 ...
- 【工作代码】复杂 JSON 值替换处理
总结下最近的工作遇到的点:入参复杂 JSON 层层嵌套,Java 怎么优雅的处理. 一.关于 JSON JSON 是类似 XML 用于存储和交互文本信息.但优于 XML ,其更小,更快,更易懂和解析. ...
- PHP cURL应用实现模拟登录与采集使用方法详解
对于做过数据采集的人来说,cURL一定不会陌生.虽然在PHP中有file_get_contents函数可以获取远程链接的数据,但是它的可控制性太差了,对于各种复杂情况的采集情景,file_get_co ...
- mono+jexus 验证码不显示:System.Drawing
System.ArgumentException The requested FontFamily could not be found [GDI+ status: FontFamilyNotFoun ...
- Android动画效果translate、scale、alpha、rotate详解
动画类型 Android的animation由四种类型组成 XML中 alpha 渐变透明度动画效果 scale 渐变尺寸伸缩动画效果 translate 画面转换位置移动动画效果 rotate 画面 ...
- [CS231n-CNN] Linear classification II, Higher-level representations, image features, Optimization, stochastic gradient descent
课程主页:http://cs231n.stanford.edu/ loss function: -Multiclass SVM loss: 表示实际应该属于的类别的score.因此,可以发现,如果实际 ...
- jquery select选中表单特效三级联动
好久没发帖了,今天发一个jquery select的表单三级联动,希望能对有需要的朋友有点帮助. js代码,当然还要加上jquery的包,应该都有的,这里就不发了. <script type=& ...