Visual Studio 调用错误的工具链 [英] Visual Studio invokes wrong toolchain

查看:29
本文介绍了Visual Studio 调用错误的工具链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用进程监视器来检查哪个可执行文件被调用.看起来它真的调用了 vs2008 可执行文件...

I used process Monitor to check, which executable gets invoked. it Looks like it really invokes the vs2008 executables...

https://skydrive.live.com/redir?resid=5062EFE7E0C8ECCC!2722&authkey=!AMdRW6t5aMB3u10&v=3&ithint=photo%2c.PNG

msbuild.exe 执行 [(12.0)tracker.exe],但将其 [(9.0)cl.exe] 作为命令行参数...

msbuild.exe executes [(12.0)tracker.exe], but gives it [(9.0)cl.exe] as command line Argument...

知道如何解决这个问题吗?

Any idea, how to solve this?

原创

在我的工作计算机上,C++ 的 VS 默认模板产生构建错误.(VS2010、VS2012、VS2013)

on my work computer, The VS Default templates for c++ produce build Errors. (VS2010, VS2012, VS2013)

它有点像调用旧版本的编译器(unknown Option '/sdl',其中 sdl 可能代表安全开发生命周期,它已随 vs2012 添加,如果我记得的话正确)

It Kind of Looks like it invokes an old Version of the Compiler (unknown Option '/sdl', where sdl probably stands for security development LifeCycle, which has been added with vs2012, if i remember correctly)

操作系统:Windows 8 (x64)已安装的 VS 版本:2008、2010、2012、2013(按此顺序)

OS: Windows 8 (x64) Installed VS Versions: 2008, 2010, 2012, 2013 (in this order)

我已经尝试过重新安装 vs2013 并重置设置.

i already tried reinstalling vs2013 and resetting the Settings.

VS2010

Visual C++ -> Win32 -> Win32 控制台应用程序(在向导的第一页完成)

1>------ Build started: Project: asd, Configuration: Debug Win32 ------
1>Build started 11.12.2013 00:22:53.
1>PrepareForBuild:
1>  Creating directory "c:\users\myusername\documents\visual studio 2010\Projects\asd\Debug\".
1>InitializeBuildStatus:
1>  Creating "Debug\asd.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1>  stdafx.cpp
1>  asd.cpp
1>RC : fatal error RC1106: invalid option: -ologo
1>  
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.56
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

VS2013

Visual C++ -> Win32 -> Win32 控制台应用程序(在向导的第一页完成)

1>------ Rebuild All started: Project: ConsoleApplication1, Configuration: Debug Win32 ------
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1>  stdafx.cpp
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1>  ConsoleApplication1.cpp
1>LINK : fatal error LNK1117: syntax error in option 'manifest:embed'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

如果我去属性->清单工具->输入和输出并将嵌入清单更改为,它有效(并且警告也消失了)

If i go to Properties -> Manifest Tool -> Input and Output and Change Embed Manifest from Yes to No, it works (and the warning disappears too)

Visual C++ -> MFC -> MFC 应用程序(在向导的第一页完成)

1>------ Build started: Project: MFCApplication4, Configuration: Debug Win32 ------
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1>  stdafx.cpp
1>cl : Command line warning D9002: ignoring unknown option '/sdl'
1>  ViewTree.cpp
1>  PropertiesWnd.cpp
1>  OutputWnd.cpp
1>  MFCApplication4View.cpp
1>  MFCApplication4Doc.cpp
1>  MFCApplication4.cpp
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(39): error C2065: 'm_dwRestartManagerSupportFlags' : undeclared identifier
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(39): error C2065: 'AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS' : undeclared identifier
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(49): error C3861: 'SetAppID': identifier not found
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mfcapplication4.cpp(86): error C3861: 'EnableTaskbarInteraction': identifier not found
1>  MainFrm.cpp
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mainfrm.cpp(351): error C2653: 'CMFCVisualManagerVS2008' : is not a class or namespace name
1>c:\users\myusername\documents\visual studio 2013\projects\mfcapplication4\mfcapplication4\mainfrm.cpp(356): error C2653: 'CMFCVisualManagerWindows7' : is not a class or namespace name
1>  FileView.cpp
1>  ClassView.cpp
1>  ChildFrm.cpp
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

如果我配置了一个基于 MFC-Dialog 的应用程序(这是我最初的目标),我会收到以下错误:

If i configure a MFC-Dialog based Application (which was my original goal), i get the following error:

1>------ Build started: Project: MFCApplication3, Configuration: Debug Win32 ------
1>  stdafx.cpp
1>  MFCApplication3Dlg.cpp
1>  MFCApplication3.cpp
1>  Generating Code...
1>RC : fatal error RC1106: invalid option: -ologo
1>  
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

不知道是否有帮助,但这里列出了所有已安装的 MS 软件:https://skydrive.live.com/redir?resid=5062EFE7E0C8ECCC!2721&authkey=!APk3skYPRCffPWQ&ithint=folder%2c

No idea if it helps, but here is a list with all installed MS Software: https://skydrive.live.com/redir?resid=5062EFE7E0C8ECCC!2721&authkey=!APk3skYPRCffPWQ&ithint=folder%2c

推荐答案

好的,我自己找到了解决方案.

Ok, i found the solution myself.

与此类似(http://social.msdn.microsoft.com/Forums/de-DE/baf613fc-3b24-4f47-9800-38499965e9dc/vs2010-is-using-a-wrong-compiler-Version) 问题,我的Microsoft.Cpp.Win32.user"属性表包含对 vs2008 目录的引用.我不知道它们是如何到达那里的,但移除它们解决了我的问题.

similar to this (http://social.msdn.microsoft.com/Forums/de-DE/baf613fc-3b24-4f47-9800-38499965e9dc/vs2010-is-using-a-wrong-compiler-Version) question, my "Microsoft.Cpp.Win32.user" property sheet contained references to the vs2008 directories. i have no clue how they got there, but removing them solved my problem.

打开查看 -> 其他窗口 -> 物业管理器

双击Microsoft.Cpp.Win32.user

转到VC++目录

已更改的行以粗体显示.在所有粗体行上,在文本字段内单击,然后在下拉菜单中选择从父级或项目默认值继承

rows which have been changed are bold. on all bold rows, click inside the text field, then on the Dropdown menu select inherit from parent or Project Defaults

我通过编译以下代码片段来验证它现在使用了正确的编译器:

I verified that it now uses the correct Compiler by compiling the following snippet:

auto asd = std::make_unique<int>();

make_unique 已在 VS2013 中添加.

make_unique has been added with VS2013.

有谁知道,是什么改变了这些值?

Anyone have a clue, what changed These values?

这篇关于Visual Studio 调用错误的工具链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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