简体   繁体   English

我需要在TeamCity服务器或Team Foundation Build Service上为C ++项目/ VS 2013安装什么?

[英]What do I need to install for C++ project / VS 2013 on TeamCity server or Team Foundation Build Service?

I am attempting to build a C++ project in a Visual Studio 2013 solution on TC 8.0.6 (build 27767). 我试图在TC 8.0.6(内部版本27767)的Visual Studio 2013解决方案中构建C ++项目。

I have installed the latest MSBuild "Microsoft Build Tools 2013" stuff (which is normally installed as part of VS 2013 install) directly on the server. 我已经在服务器上直接安装了最新的MSBuild“ Microsoft Build Tools 2013”​​资料(通常作为VS 2013安装的一部分安装)。

But I get the following error: 但是我收到以下错误:

[17:05:23]VCTargetsPath is c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\
[17:05:23]PlatformToolset is v120
[17:05:23]VCMessage
[17:05:23]c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32
Microsoft.Cpp.Win32.Targets(512, 5): error MSB8008: Specified platform toolset (v120) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
[17:05:23]Project MyCppProject\smCpp.vcxproj failed

As far as I can see I have everything I need and I have tried various hacks to set the PlatformToolset to v110 etc., but that doesn't work either. 据我所知,我已经拥有了所需的一切,并且尝试了各种破解方法,将PlatformToolset设置为v110等,但是那也不起作用。

At this stage I would like to verify exactly what I need to install on the build server. 在此阶段,我想确切验证我需要在构建服务器上安装的内容。 Can someone clarify if I need anything extra please? 有人可以澄清一下我是否需要额外的东西?

Many thanks 非常感谢

Brian 布赖恩

Ultimately you need to set the correct path to MSBuild. 最终,您需要为MSBuild设置正确的路径。 With VS 2013, build tooling became part of VS rather than .NET, making it version 12.0 instead of 4.0. 在VS 2013中,构建工具成为VS而不是.NET的一部分,从而使其成为12.0版本而不是4.0版本。 The default path in this instance is: 此实例中的默认路径是:

"C:\\Program Files (x86)\\MSBuild\\12.0\\bin" “ C:\\ Program Files(x86)\\ MSBuild \\ 12.0 \\ bin”

If the team foundation build is broken then it's likely because the TF server is not on version 2013. To fix the problem you need to make yourself a copy of the build template the build definition uses (assuming your version is >= 2010 and < 2013) and point to the correct tooling folder. 如果团队基础构建已损坏,则可能是因为TF服务器不在2013版上。要解决此问题,您需要使自己成为构建定义使用的构建模板的副本(假设您的版本为> = 2010和<2013 ),然后指向正确的工具文件夹。 The build templates are located in the following source path: 构建模板位于以下源路径中:

$/YourTeamProjectName/BuildProcessTemplates $ / YourTeamProjectName / BuildProcessTemplates

If you can edit the template in Visual Studio you open the Workflow Foundation design surface. 如果可以在Visual Studio中编辑模板,则可以打开Workflow Foundation设计图。 In there find the Run MSBuild for Project tasks (note in the default template there is more than one, but I've shown a pic of what to look for) and change the tool path property to the above path. 在其中找到“ 运行MSBuild for Project”任务(请注意,默认模板中有多个任务,但是我显示了要查找的图片)并将工具路径属性更改为上述路径。

团队建设模板

Once you created the template you need to change your build definition to use the new template. 创建模板后,您需要更改构建定义以使用新模板。

For TeamCity you need to set the MSBuild ToolsVersion to version 12.0 in your build step. 对于TeamCity,您需要在构建步骤中将MSBuild ToolsVersion设置为版本12.0。 I'm not sure what version of TC started support for version 12. 我不确定哪个版本的TC开始支持版本12。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我需要做什么才能让 cocoapods 与 C++ 一起构建? - What do I need to do to get cocoapods to build with C++? 我需要安装什么才能获得在 Windows Server 2012 R2 Standard 上运行的 C++ hello world.exe 的 x64 调试版本? - What do I need to install to get x64 debug build of C++ hello world .exe running on Windows Server 2012 R2 Standard? 在Visual Studio 2013中为我的C ++项目使用Boost库我应该怎么做 - what should I do to use boost library for my c++ project in VisualStudio 2013 我需要做什么来构建Android(NDK)的WebRTC(的一部分)? 它找不到C ++标头 - What do I need to do to build (parts of) WebRTC for Android (NDK)? It can't find C++ headers Eclipse和C / C ++ - 我是否需要单独安装编译器? - Eclipse & C/C++ - do I need to install a compiler separately? 每当我想构建一个新的c / c ++项目时,是否需要在vscode中创建一个task.json文件? - Do I need to create a tasks.json file in vscode everytime I want to build a new c/c++ project? vs2013 C ++项目中的单元测试问题 - Trouble with unit tests in vs2013 c++ project 在C ++项目(VS2013)中使用librdkafka - Use librdkafka in a C++ project (VS2013) 在VS 2013 Project中引用第三方C ++ DLL - Reference 3rd-party C++ DLL into VS 2013 Project 使用静态链接到OpenCV(C ++)在VS2013中编译项目 - Compile a project in VS2013 with static linking to OpenCV (C++)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM