安装VS 2012后无法编译我的c ++项目

时间:2014-03-14 14:05:28

标签: visual-c++

  

错误1错误MSB4018:" MIDL"任务意外失败。   System.TypeInitializationException:类型初始值设定项   ' Microsoft.Build.Utilities.FileTracker'抛出一个例外。 --->   System.IO.FileNotFoundException:系统找不到该文件   指定。 (来自HRESULT的异常:0x80070002)at   System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(的Int32   errorCode,IntPtr errorInfo)at   System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(的Int32   errorCode)at   Microsoft.Build.Shared.NativeMethodsShared.ThrowExceptionForErrorCode(的Int32   errorCode)at   Microsoft.Build.Shared.NativeMethodsShared.GetShortFilePath(字符串   在Microsoft.Build.Utilities.FileTracker..cctor()---的结尾   内部异常堆栈跟踪--- at   Microsoft.Build.CPPTasks.TrackedVCToolTask​​.ComputeOutOfDateSources()   在Microsoft.Build.CPPTasks.TrackedVCToolTask​​.SkipTaskExecution()at   Microsoft.Build.Utilities.ToolTask​​.Execute()at   Microsoft.Build.CPPTasks.TrackedVCToolTask​​.Execute()at   Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()   在   Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()   C:\ Program Files   (x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V110 \ Microsoft.CppCommon.targets 1179

1 个答案:

答案 0 :(得分:0)

这个问题会影响所有项目吗?

从旧版本的VS移植代码时遇到了类似的问题。根据我的经验,大多数错误都是因为路径生成的。我不记得细节,但明确地使用输出路径(在旧版本中完成)会产生问题,因为项目转换机制会尝试使用宏,因此会产生错误格式化的空路径。

我的建议是验证与输出有关的所有设置。确保正确设置OutputPath,TargetDir等。尝试更改设置并使用从父级继承。 创建相同类型的空项目并比较两者的属性。

相关问题