Microsoft.Cpp.Win32.Targets(62,5):错误:必填文件""不见了

时间:2015-07-09 17:47:52

标签: c++ visual-studio-2010 msbuild

今天,我在Visual Studio 2010 Pro中创建了一个新的C ++项目,然后我编译它,我得到以下两个错误:

1   error : Required file "" is missing.    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets   62  6   Test

2   IntelliSense: cannot open source file "SDKDDKVer.h" c:\users\champad\documents\applications\leadinghedge-rebuild\leadinghedge\test\targetver.h  8   1   Test

第一个错误指向Microsoft.Cpp.Win32.Targets文件中的此标记:

<CL Condition="'%(ClCompile.PrecompiledHeader)' == 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true'"
    BuildingInIDE                      ="$(BuildingInsideVisualStudio)"
    Sources                            ="@(ClCompile)"

    AdditionalIncludeDirectories       ="%(ClCompile.AdditionalIncludeDirectories)"
    AdditionalOptions                  ="%(ClCompile.AdditionalOptions)"
    AdditionalUsingDirectories         ="%(ClCompile.AdditionalUsingDirectories)"
    AssemblerListingLocation           ="%(ClCompile.AssemblerListingLocation)"
    AssemblerOutput                    ="%(ClCompile.AssemblerOutput)"
    BasicRuntimeChecks                 ="%(ClCompile.BasicRuntimeChecks)"
    BrowseInformation                  ="%(ClCompile.BrowseInformation)"
    BrowseInformationFile              ="%(ClCompile.BrowseInformationFile)"
    BufferSecurityCheck                ="%(ClCompile.BufferSecurityCheck)"
    CallingConvention                  ="%(ClCompile.CallingConvention)"
    CompileAsManaged                   ="%(ClCompile.CompileAsManaged)"
    CompileAs                          ="%(ClCompile.CompileAs)"
    DebugInformationFormat             ="%(ClCompile.DebugInformationFormat)"
    DisableLanguageExtensions          ="%(ClCompile.DisableLanguageExtensions)"
    DisableSpecificWarnings            ="%(ClCompile.DisableSpecificWarnings)"
    EnableEnhancedInstructionSet       ="%(ClCompile.EnableEnhancedInstructionSet)"
    EnableFiberSafeOptimizations       ="%(ClCompile.EnableFiberSafeOptimizations)"
    EnablePREfast                      ="%(ClCompile.EnablePREfast)"
    ErrorReporting                     ="%(ClCompile.ErrorReporting)"
    ExceptionHandling                  ="%(ClCompile.ExceptionHandling)"
    ExcludedInputPaths                 ="$(ExcludePath)"
    ExpandAttributedSource             ="%(ClCompile.ExpandAttributedSource)"
    FavorSizeOrSpeed                   ="%(ClCompile.FavorSizeOrSpeed)"
    FloatingPointExceptions            ="%(ClCompile.FloatingPointExceptions)"
    FloatingPointModel                 ="%(ClCompile.FloatingPointModel)"
    ForceConformanceInForLoopScope     ="%(ClCompile.ForceConformanceInForLoopScope)"
    ForcedIncludeFiles                 ="%(ClCompile.ForcedIncludeFiles)"
    ForcedUsingFiles                   ="%(ClCompile.ForcedUsingFiles)"
    FunctionLevelLinking               ="%(ClCompile.FunctionLevelLinking)"
    GenerateXMLDocumentationFiles      ="%(ClCompile.GenerateXMLDocumentationFiles)"
    IgnoreStandardIncludePath          ="%(ClCompile.IgnoreStandardIncludePath)"
    InlineFunctionExpansion            ="%(ClCompile.InlineFunctionExpansion)"
    IntrinsicFunctions                 ="%(ClCompile.IntrinsicFunctions)"
    MinimalRebuild                     ="%(ClCompile.MinimalRebuild)"
    MultiProcessorCompilation          ="%(ClCompile.MultiProcessorCompilation)"
    ObjectFileName                     ="%(ClCompile.ObjectFileName)"
    OmitDefaultLibName                 ="%(ClCompile.OmitDefaultLibName)"
    OmitFramePointers                  ="%(ClCompile.OmitFramePointers)"
    OpenMPSupport                      ="%(ClCompile.OpenMPSupport)"
    Optimization                       ="%(ClCompile.Optimization)"
    PrecompiledHeader                  ="%(ClCompile.PrecompiledHeader)"
    PrecompiledHeaderFile              ="%(ClCompile.PrecompiledHeaderFile)"
    PrecompiledHeaderOutputFile        ="%(ClCompile.PrecompiledHeaderOutputFile)"
    PreprocessKeepComments             ="%(ClCompile.PreprocessKeepComments)"
    PreprocessorDefinitions            ="%(ClCompile.PreprocessorDefinitions)"
    PreprocessSuppressLineNumbers      ="%(ClCompile.PreprocessSuppressLineNumbers)"
    PreprocessToFile                   ="%(ClCompile.PreprocessToFile)"
    ProcessorNumber                    ="%(ClCompile.ProcessorNumber)"
    ProgramDataBaseFileName            ="%(ClCompile.ProgramDataBaseFileName)"
    RuntimeLibrary                     ="%(ClCompile.RuntimeLibrary)"
    RuntimeTypeInfo                    ="%(ClCompile.RuntimeTypeInfo)"
    ShowIncludes                       ="%(ClCompile.ShowIncludes)"
    SmallerTypeCheck                   ="%(ClCompile.SmallerTypeCheck)"
    StringPooling                      ="%(ClCompile.StringPooling)"
    StructMemberAlignment              ="%(ClCompile.StructMemberAlignment)"
    SuppressStartupBanner              ="%(ClCompile.SuppressStartupBanner)"
    TreatSpecificWarningsAsErrors      ="%(ClCompile.TreatSpecificWarningsAsErrors)"
    TreatWarningAsError                ="%(ClCompile.TreatWarningAsError)"
    TreatWChar_tAsBuiltInType          ="%(ClCompile.TreatWChar_tAsBuiltInType)"
    UndefineAllPreprocessorDefinitions ="%(ClCompile.UndefineAllPreprocessorDefinitions)"
    UndefinePreprocessorDefinitions    ="%(ClCompile.UndefinePreprocessorDefinitions)"
    UseFullPaths                       ="%(ClCompile.UseFullPaths)"
    UseUnicodeForAssemblerListing      ="%(ClCompile.UseUnicodeForAssemblerListing)"
    WarningLevel                       ="%(ClCompile.WarningLevel)"
    WholeProgramOptimization           ="%(ClCompile.WholeProgramOptimization)"
    XMLDocumentationFileName           ="%(ClCompile.XMLDocumentationFileName)"
    CreateHotpatchableImage            ="%(CLCompile.CreateHotpatchableImage)"

    TrackerLogDirectory                ="%(ClCompile.TrackerLogDirectory)"

    TLogReadFiles                      ="@(CLTLogReadFiles)"
    TLogWriteFiles                     ="@(CLTLogWriteFiles)"
    ToolExe                            ="$(CLToolExe)"
    ToolPath                           ="$(CLToolPath)"
    TrackFileAccess                    ="$(TrackFileAccess)"
    MinimalRebuildFromTracking         ="%(ClCompile.MinimalRebuildFromTracking)"
    ToolArchitecture                   ="$(CLToolArchitecture)"
    TrackerFrameworkPath               ="$(CLTrackerFrameworkPath)"
    TrackerSdkPath                     ="$(CLTrackerSdkPath)"
    TrackedInputFilesToIgnore      ="@(ClNoDependencies)"

    AcceptableNonZeroExitCodes         ="%(ClCompile.AcceptableNonZeroExitCodes)"
    YieldDuringToolExecution           ="$(ClYieldDuringToolExecution)"
>
</CL>

我尝试重新安装7.1 SDK,但每次尝试时都会安装文件。是什么导致了这个?

1 个答案:

答案 0 :(得分:3)

这为我解决了这个问题:

首先,我遇到了一个无法找到WindowSDKDir属性的错误。我必须转到我的项目设置 - >配置属性 - &gt;常规 - &gt;平台工具集,并将其更改为Windows7.1SDK

然后,我遇到Required file "" is missing错误。我不得不打开注册表并进行更改:

HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\C:\Program Files\Microsoft SDKs\Windows\v7.1\(已移除(x86))。

之后,CL.exe退出,代码为-1073741515。我不得不将以下内容添加到我的路径中:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE

在完成所有这些工作后,事实证明我正在构建的项目正在使用一些只包含Visual Studio 2010的包含文件,因此无论如何我必须安装整个dang事物。

希望这对其他人有帮助,我不会浪费我的下午。 :P