使用Microsoft C ++编译器而不安装Visual Studio [英] Using Microsoft C++ compiler without installing Visual Studio

查看:2536
本文介绍了使用Microsoft C ++编译器而不安装Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的团队中,开发人员都有Visual Studio 2012,我们也使用TFS2012构建。对于空间&可管理性的原因,我们不在我们的(许多)构建代理上安装Visual Studio。这已经到目前为止与C#项目(csproj)。

In our team, the devs all have Visual Studio 2012, and we also use TFS2012 build. For space & manageability reasons, we don't install Visual Studio on our (many) build agents. This has worked so far with C# projects (csproj).

现在我们要添加对C ++项目(vcxproj)的支持。这些基于开发人员的机器,但不是构建代理 - 我们得到:
X.vcxproj(31,3):错误MSB4019:导入的项目C:\Microsoft.Cpp .Default.props。确认< Import>声明是正确的,并且文件存在于磁盘上。

Now we want to add support for C++ project (vcxproj). These build on devs' machines, but not on the build agents - we get: X.vcxproj(31,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

我想这是因为C ++编译器&目标只与VS安装。

I suppose this is because the C++ compiler & targets are only installed with VS.


  1. 有一种方法只检查编译器&目标,并在我们的common.targets中设置一些属性来指向那里?

  2. 如果没有,我需要在每个构建代理上安装以支持C ++编译的最小值是多少?我最少找到的是VS Express,这对我的喜好还是太大了。


推荐答案

对于C#很简单,编译C#程序的能力在框架System.CodeDom中是固有的,所以只是安装.NET就够了。不是为C ++。你至少需要安装Windows SDK,半个gig。这包括8.0之前的SDK版本中的C ++编译器

It is simple for C#, the ability to compile C# programs is innate in the framework, System.CodeDom, so just installing .NET is enough. Not so for C++. You'll at a minimum need to install the Windows SDK, half a gig. This includes the C++ compiler in SDK versions earlier than 8.0

然而,接下来你会发现找到一种方法来获取该机器上的类库。 ATL和MFC。你不能只是复制他们,违反了许可证。更糟糕的是,微软并不像他们以前那样做生意。他们从VS2012开始切换到快速发布周期,更新运输以几个月的方式。这些不是你可以忽略的更新,他们添加了相当大的块,以实现C ++ 11。绝对是你的C ++程序员想要使用的类型。

However, you'll next get to fret about finding a way to get the class libraries on that machine. ATL and MFC for example. You can't just copy them, that violates the license. Much worse, Microsoft is not doing business the way they used to. They switched to a rapid-release cycle since VS2012 with updates shipping in a manner of months. These are not updates you can ignore, they add pretty major chunks to get C++11 implemented. Definitely the kind that your C++ programmers will want to use.

一般来说,C ++编译器的SDK版本与VS版本不同步,Windows团队没有义务保持更新。构建机器应该从不做的一件事是运行一组不同于程序员使用的构建工具。这使得构建中断,不能由一个大的讨厌的争论点重现。除非你喜欢让你的生活复杂,消息是明确的。不要这样做,安装VS。

In general, the SDK version of the C++ compiler is just not in sync with VS version, the Windows team has no obligation to keep it updated. The one thing that a build machine should never do is run a different set of build tools than the ones used by the programmers. That makes a build break that can't be reproduced by a dev a big nasty point of contention. Unless you like making your life complicated, the message is clear. Don't do it, install VS.

这篇关于使用Microsoft C ++编译器而不安装Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆