设为首页 收藏本站
查看: 748|回复: 0

[经验分享] Visual C++ 2012开发的程序 支持Windows XP

[复制链接]

尚未签到

发表于 2015-11-3 14:18:38 | 显示全部楼层 |阅读模式
Visual Studio 博客

官方来源的产品从 Visual Studio 工程团队的洞察力




















Visual C++ 2012 支持Windows XP



  与 Visual Studio 到 2012 年,我们努力在所有 Microsoft 平台提供最佳的发展经验。这包括使开发人员能够给生活带来丰富的 Windows 桌面应用程序-,是否你正在学习构建您的第一个应用程序或是否已经拟定在 Microsoft 平台上很多年。
  几个星期前,我们分享我们的 Visual Studio 2012 速成版的计划。正如我们已经提供 Visual studio 的最佳体验,我们与 Windows 8,Windows Phone 的平台和 Web 和 Windows Azure,我们听到我们开发人员要有为 Windows 桌面开发同样伟大的经验和获得最新的 Visual Studio 2012 功能快递一级的社会。
  今天,我高兴地宣布我们将添加用于 Windows 桌面 Visual Studio 表示 2012年到 Visual Studio 2012 家庭。这将使 Visual Studio 速成家庭重要新功能,我们已经为建设伟大的桌面应用程序可用 Visual Studio 2012 年。
  秉承我们为我们的快递产品而设置的核心原则,Windows 桌面的 Visual Studio 表示 2012年将为开发桌面应用程序的目标在所有支持的 Visual Studio 2012 的 Windows 版本上运行的 Windows 提供简单的、 端到端的发展经验。这个新的速成版,开发人员将能够使用 c + +、 C# 或 Visual Basic 创建 Windows 桌面和控制台应用程序。开发人员也将获得新进展可获得整个快递大家庭
Visual Studio 2012 年最新的编译器和编程语言工具、 综合的单元测试和小的开发团队能力合作,通过团队资源管理器和 TFS 快递等。
  计划在秋季发布,Windows 桌面的 Visual Studio 表示 2012年将为学生和其他新的开发人员入门提供一个好的学习环境。它将使现有的开发人员能够带来的最新工具集与他们的桌面应用程序的无摩擦的解决方案。它将使开放源代码目标现有和以前版本的 Windows 应用程序开发人员。
  桌面发展一直是 Windows 的核心部分。与 Visual Studio 2012 年我们继续扩展这些桌面开发能力和构建桌面应用程序的开发人员提供很大的发展经验。
这厢有礼了 !
Somasegar


设置编绎器选项,让VC++ 2012 开发的程序支持windows xp

---------------------------------------------------------------------------------------------------------  Hello, my name is Li Shao. I am a Software Design Engineer in Test on the C++ team. For the past two years, I have been part of the team working on migrating the C++ build system from VCBuild to MSBuild as well as the new project system which is also
built on top of MSBuild. You can see one of my earlier blogs about the task work that we have done. In this
blog, I am going to give an overview of the Native Multi-targeting feature. I hope you will find it useful.
  
  Multi-targeting is the ability to use the current version of Visual Studio to build your application with adifferent set of installed tools or Frameworks. In VS2010, C++ applications support two types of Multi-targeting: Native Multi-targeting
and Managed Multi-targeting. For more details on Managed Multi-targeting, please visitthis blog post
by one of my colleagues, Pavan Adharapurapu.
  Native Multi-targeting
  
  VS2010 can support building against VS2008 toolsets if VS2008 is installed on the same machine. Soma has mentioned this feature in hisblog some time ago. This feature enables the C++ customers to
use VS2008 toolsets while working in the VS2010 environment. Note that your application created with earlier versions of Visual Studio will need to be converted to the VS2010 version." _msthash="1688195" _mstchunk="true">VS2010 can support building
against VS2008 toolsets if VS2008 is installed on the same machine. Soma has mentioned this feature in hisblog
some time ago. This feature enables the C++ customers to use VS2008 toolsets while working in the VS2010 environment. Note that your application created with earlier versions of Visual Studio will need to be converted to the VS2010 version.
  
  Why Native Multi-targeting?
  An important scenario for C++ customers (let’s call them “large C++ shops” here) is that they develop and build their applications in Visual Studio and then ship the applications to their respective customers. These customers, however, maybe using
different versions of Visual Studio for development. Given that, the “large C++ shops” have to keep multiple versions of Visual Studio and multiple versions of the project files, so that they can build binaries targeting different versions of the toolset.
  
  With the native Multi-targeting feature, once the “large C++ shops” migrated their applications to VS2010, they have the ability to use VS2010 to target any versions of the toolset theoretically. This eliminates the need to maintain multiple versions
of project files and the development work can be done all within VS2010, as long as the targeted toolsets are installed on the same machine.
  
  How to enable native Multi-targeting?
  The Multi-Targeting feature is available both when building from the IDE and building on the command line. Below is a screen shot of the native Multi-targeting settings on the property page: Platform Toolset controls which version of the toolsets you
want to target: v100 targets VS2010 and v90 targets the VS2008 level toolsets and libraries.
  
DSC0000.jpg
  
  The Platform toolset version is v100 by default for both newly created projects and projects converted to VS2010. In both cases, the “PlatformToolset” property is not written to the project file. There are a couple of ways you can re-target to different
PlatformToolset (v90 is used as an example below):
  
  For single project, you can choose your targeted platform toolset to be v90 in the property page, the “PlatformToolset” property will be written to your project file as the following:
  
  <PropertyGroupCondition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;Label=&quot;Configuration&quot;&gt;&quot; _msthash=&quot;1688201&quot;
_mstchunk=&quot;true&quot;>PropertyGroupCondition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;Label=&quot;Configuration&quot;>
      <ConfigurationType&gt;Application&lt;/ConfigurationType&gt;&quot; _msthash=&quot;1688202&quot; _mstchunk=&quot;true&quot;>ConfigurationType>Application</ConfigurationType>
      <UseDebugLibraries&gt;true&lt;/UseDebugLibraries&gt;&quot; _msthash=&quot;1688203&quot; _mstchunk=&quot;true&quot;>UseDebugLibraries>true</UseDebugLibraries>
      <CharacterSet&gt;Unicode&lt;/CharacterSet&gt;&quot; _msthash=&quot;1688204&quot; _mstchunk=&quot;true&quot;>CharacterSet>Unicode</CharacterSet>
      <PlatformToolset&gt;v90&lt;/PlatformToolset&gt;&quot; _msthash=&quot;1688205&quot; _mstchunk=&quot;true&quot;>PlatformToolset>v90</PlatformToolset>
  </PropertyGroup>
  
  
  
  In order to re-target multiple projects at once, you can multi-select them in Solution Explorer and then bring up the Property Pages. To make the changes apply to all configurations, also select from the Configuration dropdown “All configurations”
entry and from Platform dropdown “All platforms” entry. Note that multi-select will work only if all projects are of the same type.
  
  Once the “PlatformToolset” is set to v90, the compiler, linker, headers, and libraries from VS2008 will be used. Below is a snapshot of the build log when building against the v90 toolset from the VS2010 IDE or command line prompt. You can see that
VS2008 compiler is used instead of VS2010 compiler.
  
  c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _UNICODE /D UNICODE /D _AFXDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc&quot;StdAfx.h&quot; /Fp&quot;Debug\MFC.pch&quot;
/Fo&quot;Debug\\&quot; /Fd&quot;Debug\vc90.pdb&quot; /Gd /TP /analyze- /errorReport:prompt stdafx.cpp

  
  Note that changing the value of the Platform Toolset property will cause a full rebuild of the project.
  
  How does it work?
  In VS2010, there are V90 and V100 folders under %ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\<Platforms>\PlatformToolsets or %ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\<Platforms>\PlatformToolsets on a x64 machine. Inside each
folder, you can find a ToolSet specific props and targets file. Here is a representation of the layout of the file/directory structure on the disk:
  
   DSC0001.jpg
  
  
  Microsoft.Cpp.<Platform>.<PlatformToolset>.props file sets the properties required to build against a certain toolset. For example, in Microsoft.Cpp.Win32.v90.Props, ExecutablePath (PATH), IncludePath (INCLUDE), ReferencePath (LIBPATH), LibraryPath
(LIB), SourcePath, ExcludedPath are set based on the VS2008 installation and Windows SDK installation that shipped with VS2008 (6.0A)
  
  
  <VCInstallDir&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)&lt;/VCInstallDir&gt;&quot; _msthash=&quot;1688212&quot;
_mstchunk=&quot;true&quot;>VCInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)</VCInstallDir>
  <VCInstallDir
      Condition=&quot;'$(VCInstallDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)&lt;/VCInstallDir&gt;&quot;
_msthash=&quot;1688214&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(VCInstallDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC@ProductDir)</VCInstallDir>
  <VCInstallDir
      Condition=&quot;'$(VCInstallDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)&lt;/VCInstallDir&gt;&quot;
_msthash=&quot;1688216&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(VCInstallDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)</VCInstallDir>
  <VCInstallDir
      Condition=&quot;'$(VCInstallDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)&lt;/VCInstallDir&gt;&quot;
_msthash=&quot;1688218&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(VCInstallDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VCExpress\9.0\Setup\VC@ProductDir)</VCInstallDir>
  <WindowsSdkDir
      Condition=&quot;'$(UseEnv)' !='true'&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\Windows@CurrentInstallFolder)&lt;/WindowsSdkDir&gt;&quot; _msthash=&quot;1688220&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(UseEnv)'
!=
'true'&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder)</WindowsSdkDir>
  <WindowsSdkDir
      Condition=&quot;'$(WindowsSdkDir)'==''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MicrosoftSDKs\Windows@CurrentInstallFolder)&lt;/WindowsSdkDir&gt;&quot;
_msthash=&quot;1688222&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(WindowsSdkDir)'==''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MicrosoftSDKs\Windows@CurrentInstallFolder)</WindowsSdkDir>
  <ExecutablePath
      Condition=&quot;'$(ExecutablePath)' == ''&quot;&gt;$(VCInstallDir)bin;$(WindowsSDKDir)bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML
Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);&lt;/ExecutablePath&gt;&quot; _msthash=&quot;1688224&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(ExecutablePath)'
== ''
&quot;>$(VCInstallDir)bin;$(WindowsSDKDir)bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML
Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);
</ExecutablePath>
  <IncludePath
      Condition=&quot;'$(IncludePath)' == ''&quot;&gt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;&lt;/IncludePath&gt;&quot;
_msthash=&quot;1688226&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(IncludePath)' == ''&quot;>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;</IncludePath>
  <ReferencePath
      Condition=&quot;'$(ReferencePath)' == ''&quot;&gt;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib&lt;/ReferencePath&gt;&quot;
_msthash=&quot;1688228&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(ReferencePath)' == ''&quot;>$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib</ReferencePath>
  <LibraryPath
      Condition=&quot;'$(LibraryPath)' == ''&quot;&gt;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)lib&lt;/LibraryPath&gt;&quot;
_msthash=&quot;1688230&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(LibraryPath)' == ''&quot;>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)lib</LibraryPath>
  <SourcePath
      Condition=&quot;'$(SourcePath)' == ''&quot;&gt;$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\mfcm;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;&lt;/SourcePath&gt;&quot;
_msthash=&quot;1688232&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(SourcePath)' == ''&quot;>$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\mfcm;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>
  <ExcludePath
      Condition=&quot;'$(ExcludePath)' == ''&quot;&gt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;&lt;/ExcludePath&gt;&quot;
_msthash=&quot;1688234&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(ExcludePath)' == ''&quot;>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;</ExcludePath>
  
  MSBuild can spawn the build environment based on the information you set in the props file for a certain platform toolset. In the command line build scenarios, this means that the PATH, LIBPATH, LIB, INCLUDE that the build system is using can come
from the PlatformToolsets itself, which can eliminate the need to use other batch files, such as vcvars32.bat, to set up the build environment. This is a functionality that the old VCBuild system does not have. Below is a code snippet from Microsoft.cpp.Targets
that enables the functionality. When UseEnv is not set to true, PATH, LIB, INCLUDE, LIBPATH will be set from the corresponding property values in the platform toolset. When UseEnv is set to true, as in old build system, the values from environment variables
for PATH, INCLUDE, LIB, LIBPATH will be used, instead.
  
  <TargetName=&quot;SetBuildDefaultEnvironmentVariables&quot;&quot; _msthash=&quot;1920036&quot; _mstchunk=&quot;true&quot;>TargetName=&quot;SetBuildDefaultEnvironmentVariables&quot;
            Condition=&quot;'$(UseEnv)' != 'true'&quot;&gt;&quot; _msthash=&quot;1920037&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(UseEnv)'
!= 'true'
&quot;>
      <SetEnvCondition=&quot;'$(_IsNativeEnvironment)' != 'true'&quot;&quot; _msthash=&quot;1920038&quot; _mstchunk=&quot;true&quot;>SetEnvCondition=&quot;'$(_IsNativeEnvironment)'
!= 'true'
&quot;
              Name =&quot;PATH&quot;&quot; _msthash=&quot;1920039&quot; _mstchunk=&quot;true&quot;>Name =&quot;PATH&quot;
              Value =&quot;$(ExecutablePath)&quot;&quot; _msthash=&quot;1920040&quot; _mstchunk=&quot;true&quot;>Value =&quot;$(ExecutablePath)&quot;
              Prefix =&quot;false&quot;&gt;&quot; _msthash=&quot;1920041&quot; _mstchunk=&quot;true&quot;>Prefix =&quot;false&quot;>
        <OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;Path&quot;/&gt;&quot; _msthash=&quot;1920042&quot; _mstchunk=&quot;true&quot;>OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;Path&quot;/>
      </SetEnv>
      <SetEnvCondition=&quot;'$(_IsNativeEnvironment)' == 'true'&quot;&quot; _msthash=&quot;1920044&quot; _mstchunk=&quot;true&quot;>SetEnvCondition=&quot;'$(_IsNativeEnvironment)'
== 'true'
&quot;
              Name =&quot;PATH&quot;&quot; _msthash=&quot;1920045&quot; _mstchunk=&quot;true&quot;>Name =&quot;PATH&quot;
              Value =&quot;$(NativeExecutablePath)&quot;&quot; _msthash=&quot;1920046&quot; _mstchunk=&quot;true&quot;>Value =&quot;$(NativeExecutablePath)&quot;
              Prefix =&quot;false&quot;&gt;&quot; _msthash=&quot;1920047&quot; _mstchunk=&quot;true&quot;>Prefix =&quot;false&quot;>
        <OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;Path&quot;/&gt;&quot; _msthash=&quot;1920048&quot; _mstchunk=&quot;true&quot;>OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;Path&quot;/>
      </SetEnv>
      <SetEnvName =&quot;LIB&quot;&quot; _msthash=&quot;1920050&quot; _mstchunk=&quot;true&quot;>SetEnvName
=
&quot;LIB&quot;
              Value =&quot;$(LibraryPath)&quot;&quot; _msthash=&quot;1920051&quot; _mstchunk=&quot;true&quot;>Value =&quot;$(LibraryPath)&quot;
              Prefix =&quot;false&quot;&gt;&quot; _msthash=&quot;1920052&quot; _mstchunk=&quot;true&quot;>Prefix =&quot;false&quot;>
        <OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;LIB&quot;/&gt;&quot; _msthash=&quot;1920053&quot; _mstchunk=&quot;true&quot;>OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;LIB&quot;/>
      </SetEnv>
      <SetEnvName =&quot;LIBPATH&quot;&quot; _msthash=&quot;1920055&quot; _mstchunk=&quot;true&quot;>SetEnvName
=
&quot;LIBPATH&quot;
              Value =&quot;$(ReferencePath)&quot;&quot; _msthash=&quot;1920056&quot; _mstchunk=&quot;true&quot;>Value =&quot;$(ReferencePath)&quot;
              Prefix =&quot;false&quot;&gt;&quot; _msthash=&quot;1920057&quot; _mstchunk=&quot;true&quot;>Prefix =&quot;false&quot;>
        <OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;LIBPATH&quot;/&gt;&quot; _msthash=&quot;1920058&quot; _mstchunk=&quot;true&quot;>OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;LIBPATH&quot;/>
      </SetEnv>
      <SetEnvName =&quot;INCLUDE&quot;&quot; _msthash=&quot;1920060&quot; _mstchunk=&quot;true&quot;>SetEnvName
=
&quot;INCLUDE&quot;
              Value =&quot;$(IncludePath)&quot;&quot; _msthash=&quot;1920061&quot; _mstchunk=&quot;true&quot;>Value =&quot;$(IncludePath)&quot;
              Prefix =&quot;false&quot; &gt;&quot; _msthash=&quot;1920062&quot; _mstchunk=&quot;true&quot;>Prefix =&quot;false&quot;
>

        <OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;INCLUDE&quot;/&gt;&quot; _msthash=&quot;1920063&quot; _mstchunk=&quot;true&quot;>OutputTaskParameter=&quot;OutputEnvironmentVariable&quot;PropertyName=&quot;INCLUDE&quot;/>
      </SetEnv>
    </Target>
  
  
  For managed applications, since the VS2008 compiler can only target CLR 2.0, targeting v90 platform toolset it allows only one of these versions of .NET Framework: v2.0, v3.0 or v3.5. By default, v90 platform toolset target v3.5 framework.
  
  How to extend it?
  With this model, if you have a specific SDK that you would like to target, you can create your custom platform toolset. Below is an example of a Microsoft.cpp.Win32.v80.props file for targeting VS2005. Note that for VS2005, WindowsSDKDir is not available,
we have PlatformSDK instead. After creating the v80 directory for each platform along with the corresponding props and targets files, you will have support to build against v80 instantly.
  
  <Projectxmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;&quot; _msthash=&quot;1920068&quot; _mstchunk=&quot;true&quot;>Projectxmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;>
    <ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportBefore\*.props&quot;Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v80\ImportBefore')&quot;
/&gt;&quot; _msthash=&quot;1920069&quot; _mstchunk=&quot;true&quot;>ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportBefore\*.props&quot;Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v80\ImportBefore')&quot;
/>

    <PropertyGroup>
      <PlatformToolsetVersion&gt;80&lt;/PlatformToolsetVersion&gt;&quot; _msthash=&quot;1920071&quot; _mstchunk=&quot;true&quot;>PlatformToolsetVersion>80</PlatformToolsetVersion>
      <VCInstallDir&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)&lt;/VCInstallDir&gt;&quot; _msthash=&quot;1920072&quot;
_mstchunk=&quot;true&quot;>VCInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)</VCInstallDir>
      <VCInstallDir
          Condition=&quot;'$(VCInstallDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)&lt;/VCInstallDir&gt;&quot;
_msthash=&quot;1920074&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(VCInstallDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VC@ProductDir)</VCInstallDir>
      <VSInstallDir&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)&lt;/VSInstallDir&gt;&quot;
_msthash=&quot;1920075&quot; _mstchunk=&quot;true&quot;>VSInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)</VSInstallDir>
      <VSInstallDir
          Condition=&quot;'$(VSInstallDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)&lt;/VSInstallDir&gt;&quot;
_msthash=&quot;1920077&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(VSInstallDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VS@ProductDir)</VSInstallDir>
      <FrameworkDir
          Condition=&quot;'$(UseEnv)' != 'true'&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)&lt;/FrameworkDir&gt;&quot;
_msthash=&quot;1920079&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(UseEnv)' != 'true'&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)</FrameworkDir>
      <FrameworkDir
          Condition=&quot;'$(FrameworkDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)&lt;/FrameworkDir&gt;&quot;
_msthash=&quot;1920081&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(FrameworkDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework@InstallRoot)</FrameworkDir>
      <FrameworkSdkDir
          Condition=&quot;'$(UseEnv)' != 'true'&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\.NETFrameWork\v2.0@InstallationFolder)&lt;/FrameworkSdkDir&gt;&quot;
_msthash=&quot;1920083&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(UseEnv)' != 'true'&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>
      <FrameworkSdkDir
          Condition=&quot;'$(FrameworkSdkDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\.NETFrameWork\v2.0@InstallationFolder)&lt;/FrameworkSdkDir&gt;&quot;
_msthash=&quot;1920085&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(FrameworkSdkDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>
      <FrameworkSdkDir
          Condition=&quot;'$(FrameworkSdkDir)' == ''&quot;&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\.NETFrameWork\v2.0@InstallationFolder)&lt;/FrameworkSdkDir&gt;&quot;
_msthash=&quot;1920087&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(FrameworkSdkDir)' == ''&quot;>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft
SDKs\.NETFrameWork\v2.0@InstallationFolder)</FrameworkSdkDir>
      <FrameworkVersion
          Condition=&quot;'$(UseEnv)' != 'true'&quot;&gt;v2.0.50727&lt;/FrameworkVersion&gt;&quot; _msthash=&quot;1920089&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(UseEnv)'
!= 'true'
&quot;>v2.0.50727</FrameworkVersion>
      <Framework35Version
          Condition=&quot;'$(UseEnv)' != 'true'&quot;&gt;v3.5&lt;/Framework35Version&gt;&quot; _msthash=&quot;1920091&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(UseEnv)'
!= 'true'
&quot;>v3.5</Framework35Version>
      <ExecutablePath
          Condition=&quot;'$(ExecutablePath)' == ''&quot;&gt;$(VCInstallDir)bin;$(VCInstallDir)PlatformSDK\bin;$(VCInstallDir)PlatformSDK\common\bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML
Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);&lt;/ExecutablePath&gt;&quot; _msthash=&quot;1920093&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(ExecutablePath)'
== ''
&quot;>$(VCInstallDir)bin;$(VCInstallDir)PlatformSDK\bin;$(VCInstallDir)PlatformSDK\common\bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
      <IncludePath
          Condition=&quot;'$(IncludePath)' == ''&quot;&gt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;&lt;/IncludePath&gt;&quot;
_msthash=&quot;1920095&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(IncludePath)' == ''&quot;>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;</IncludePath>
      <ReferencePath
          Condition=&quot;'$(ReferencePath)' == ''&quot;&gt;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;&lt;/ReferencePath&gt;&quot;
_msthash=&quot;1920097&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(ReferencePath)' == ''&quot;>$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;</ReferencePath>
      <LibraryPath
          Condition=&quot;'$(LibraryPath)' == ''&quot;&gt;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)atlmfc\lib\i386;$(VCInstallDir)PlatformSDK\lib;$(VCInstallDir)PlatformSDK\common\lib;$(FrameworkSDKDir)lib;$(VSInstallDir);$(VSInstallDir)lib;&lt;/LibraryPath&gt;&quot;
_msthash=&quot;1920099&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(LibraryPath)' == ''&quot;>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(VCInstallDir)atlmfc\lib\i386;$(VCInstallDir)PlatformSDK\lib;$(VCInstallDir)PlatformSDK\common\lib;$(FrameworkSDKDir)lib;$(VSInstallDir);$(VSInstallDir)lib;</LibraryPath>
      <SourcePath
          Condition=&quot;'$(SourcePath)' == ''&quot;&gt;$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;&lt;/SourcePath&gt;&quot;
_msthash=&quot;1920101&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(SourcePath)' == ''&quot;>$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>
      <ExcludePath
          Condition=&quot;'$(ExcludePath)' == ''&quot;&gt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;&lt;/ExcludePath&gt;&quot;
_msthash=&quot;1920103&quot; _mstchunk=&quot;true&quot;>Condition=&quot;'$(ExcludePath)' == ''&quot;>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(VCInstallDir)PlatformSDK\include;$(VCInstallDir)PlatformSDK\common\include;$(FrameworkSDKDir)include;$(FrameworkDir)$(FrameworkVersion);$(VCInstallDir)atlmfc\lib;</ExcludePath>
      <NativeExecutablePath
          Condition=&quot;'$(NativeExecutablePath)' == ''&quot;&gt;$(ExecutablePath)&lt;/NativeExecutablePath&gt;&quot; _msthash=&quot;1920105&quot;
_mstchunk=&quot;true&quot;>Condition=&quot;'$(NativeExecutablePath)' == ''&quot;>$(ExecutablePath)</NativeExecutablePath>
    </PropertyGroup>
    <ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportAfter\*..props&quot;Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\
PlatformToolsets\v80\ImportAfter')&quot; /&gt;&quot; _msthash=&quot;1920107&quot; _mstchunk=&quot;true&quot;>ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\
PlatformToolsets\v80\ImportAfter\*..props
&quot;Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\ PlatformToolsets\v80\ImportAfter')&quot;
/>

  </Project>
  
  
  Below is a snapshot of the IDE build setting and the build log:
  
  
  
  The Platform Toolset feature also provides the extensibility points. In the Microsoft.Cpp.Win32.<PlatformToolset version>.props file, there are the following sections:
  
  <ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore\*.props&quot;&quot; _msthash=&quot;1920111&quot; _mstchunk=&quot;true&quot;>ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore\*.props&quot;
          Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore')&quot; /&gt;&quot; _msthash=&quot;1920112&quot; _mstchunk=&quot;true&quot;>Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportBefore')&quot;
/>

  
  <ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter\*.props&quot;&quot; _msthash=&quot;1920113&quot; _mstchunk=&quot;true&quot;>ImportProject=&quot;$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter\*.props&quot;
          Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter')&quot; /&gt;&quot; _msthash=&quot;1920114&quot; _mstchunk=&quot;true&quot;>Condition=&quot;Exists('$(VCTargetsPath)\Platforms\Win32\PlatformToolsets\v100\ImportAfter')&quot;
/>

  
  With this design, you can create your own special props file that is specific to a certain Platform Toolset. For example, you might create a custom props file called DirectX.props (it could be called anything) which you then drop into the following
folder: win32\PlatformToolsets\v100\ImportAfter. The Properties defined in DirectX.props (below) would beimported after the properties in Microsoft.Cpp.Win32.<PlatformToolset version>.props are imported.
  
  <Projectxmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;&quot; _msthash=&quot;1920116&quot; _mstchunk=&quot;true&quot;>Projectxmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;>
    <ItemDefinitionGroup>
      <ClCompile>
  <AdditionalIncludeDirectories&gt;$(DirectXSDK)\Latest\Include;%(AdditionalIncludeDirectories)&lt;/AdditionalIncludeDirectories&gt;&quot; _msthash=&quot;1920119&quot;
_mstchunk=&quot;true&quot;>AdditionalIncludeDirectories>$(DirectXSDK)\Latest\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      </ClCompile>
      <Link>
  <AdditionalLibraryDirectories&gt;$(DirectXSDK)\Latest\Lib\x86%(AdditionalLibraryDirectories);&lt;/AdditionalLibraryDirectories&gt;&quot; _msthash=&quot;1920122&quot;
_mstchunk=&quot;true&quot;>AdditionalLibraryDirectories>$(DirectXSDK)\Latest\Lib\x86%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
      </Link>
    </ItemDefinitionGroup>
  </Project>
  
  Upon compile, you will get /I d:\DirectX\Latest\include being passed to CL.exe and /LIBPATH:d:\DirectX\Latest\Lib\x86 being passed to the linker when compiling a project targeting the Win32 platform and the v100 platform toolset. Any other project
configurations will not be impacted.
  
  Windows SDK will adopt this Platform Toolset concept for future releases so that re-targeting of different WinSDK versions becomes an easier task. We also encourage

  our customers to use this feature and let us know if you have any feedback.
  

  

In the example of the vc8 PlatformToolset above, you need to change <ExecutablePath> in Microsoft.Cpp.<Platform>.<PlatformToolset>.props to point to VS2010 compiler/linker path. For Example,
<ExecutablePath
Condition=&quot;'$(ExecutablePath)' == ''&quot;>$(VC10InstallDir)bin;$(WindowsSDKDir)bin;$(VS10InstallDir)Common7\Tools\bin;$(VS10InstallDir)Common7\tools;$(VS10InstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VS10InstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
You need to define VC10InstallDir, VS10InstallDir.


  


  
  Li Shao
  Project and Build Team

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-134596-1-1.html 上篇帖子: 在 Windows 2012 上安装 Sharepoint 2010 下篇帖子: Compiling Wireshark using MS VS Express 2012 on Windows 7
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表