<i id='uZsgu'><tr id='uZsgu'><dt id='uZsgu'><q id='uZsgu'><span id='uZsgu'><b id='uZsgu'><form id='uZsgu'><ins id='uZsgu'></ins><ul id='uZsgu'></ul><sub id='uZsgu'></sub></form><legend id='uZsgu'></legend><bdo id='uZsgu'><pre id='uZsgu'><center id='uZsgu'></center></pre></bdo></b><th id='uZsgu'></th></span></q></dt></tr></i><div id='uZsgu'><tfoot id='uZsgu'></tfoot><dl id='uZsgu'><fieldset id='uZsgu'></fieldset></dl></div>

      <small id='uZsgu'></small><noframes id='uZsgu'>

      • <bdo id='uZsgu'></bdo><ul id='uZsgu'></ul>
    1. <legend id='uZsgu'><style id='uZsgu'><dir id='uZsgu'><q id='uZsgu'></q></dir></style></legend>
      <tfoot id='uZsgu'></tfoot>

      如何在 Microsoft Visual Studio C++ 中以 Windows XP 为目标

      How to target Windows XP in Microsoft Visual Studio C++(如何在 Microsoft Visual Studio C++ 中以 Windows XP 为目标)
      • <legend id='mVz4o'><style id='mVz4o'><dir id='mVz4o'><q id='mVz4o'></q></dir></style></legend>

          <bdo id='mVz4o'></bdo><ul id='mVz4o'></ul>

          <small id='mVz4o'></small><noframes id='mVz4o'>

          <tfoot id='mVz4o'></tfoot>

                <tbody id='mVz4o'></tbody>
              <i id='mVz4o'><tr id='mVz4o'><dt id='mVz4o'><q id='mVz4o'><span id='mVz4o'><b id='mVz4o'><form id='mVz4o'><ins id='mVz4o'></ins><ul id='mVz4o'></ul><sub id='mVz4o'></sub></form><legend id='mVz4o'></legend><bdo id='mVz4o'><pre id='mVz4o'><center id='mVz4o'></center></pre></bdo></b><th id='mVz4o'></th></span></q></dt></tr></i><div id='mVz4o'><tfoot id='mVz4o'></tfoot><dl id='mVz4o'><fieldset id='mVz4o'></fieldset></dl></div>

                本文介绍了如何在 Microsoft Visual Studio C++ 中以 Windows XP 为目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在 Windows 8.1 上使用 Microsoft Visual Studio 2015.我想编译一个针对 Windows XP 的程序.我在谷歌和其他类似的问题上查过,但没有任何帮助.在解决方案设置中,目标平台工具集设置为 Windows XP 之一,但目标平台版本中没有 Windows XP 的选项.我确实读过

                这是因为默认平台工具集使用 Windows 8.1 SDK(或者您可以选择加入 Windows 10 SDK),并且这仅支持为 Windows Vista 或更高版本构建应用程序.当您选择 v140_xp 平台工具集时,您使用的是 Windows 7.1 SDK 的一个版本,这是支持面向 Windows XP 或 Windows Server 2003 的最后一个版本.

                <块引用>

                请注意,Visual Studio 可以面向 Windows XP Service Pack 3 或 Windows Server 2003 Service Pack 2.C/C++ 运行时与旧版本的 Windows 不兼容.

                如果您在应用中使用 DirectX,这会产生一些深远的影响,因为 Windows 7.1 SDK 和 Windows 8 SDK 之间发生了很大变化.请参阅

                I'm using Microsoft Visual Studio 2015 on Windows 8.1. I want to compile a program targeting Windows XP. I've looked it up on Google and other similar questions, but none helped. In the solution settings, target platform toolset is set to the Windows XP one, but there is no option for Windows XP in the target platform version. I did read https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx (Using the Windows Headers) and added these lines to my program:

                #define WINVER _WIN32_WINNT_WINXP
                #define _WIN32_WINNT _WIN32_WINNT_WINXP
                #define NTDDI_VERSION NTDDI_WINXP
                

                But it still doesn't work. It says that it can't find "MSVCP140.dll". After I got this dll, it begins to complain about can't find "VC140.dll". After that is "ucrtbased.dll", and then finally "api-ms-win-core-string-11-1-0.dll", which I don't even have it in my Windows 8.1 computer. The program can run on Windows 8.1, but not Windows XP. What can I do to make the program run on Windows XP?

                解决方案

                In order to build a Windows XP compatible EXE with VS 2015 (or VS 2012 / VS 2013) you have to use the v140_xp Platform Toolset rather than the default v140 Platform Toolset.

                UPDATE: Note that VS 2017 includes support for Windows XP via v141_xp. For VS 2019, this feature is no longer being updated but you can still install the v141_xp toolset to use with the VS 2019 IDE.

                See your Project Properties, the General page:

                This is because the default Platform Toolset uses the Windows 8.1 SDK (or you can opt into the Windows 10 SDK), and this only supports building applications for Windows Vista or later. When you select the v140_xp Platform Toolset, you are using a version of the Windows 7.1 SDK which was the last version to support targeting Windows XP or Windows Server 2003.

                Note that Visual Studio can target Windows XP Service Pack 3 or Windows Server 2003 Service Pack 2. The C/C++ Runtime is not compatible with older versions of Windows.

                If you are using DirectX in your app, this has some profound implications because a lot changed between the Windows 7.1 SDK and the Windows 8 SDK. See this post for details.

                With VS 2015, you will also need to select the Windows XP support in the Custom Install options or via Programs & Features / Microsoft Visual Studio 2015 / Change... / Modify:

                这篇关于如何在 Microsoft Visual Studio C++ 中以 Windows XP 为目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Consistent pseudo-random numbers across platforms(跨平台一致的伪随机数)
                Vary range of uniform_int_distribution(改变uniform_int_distribution的范围)
                What is a seed in terms of generating a random number?(就生成随机数而言,种子是什么?)
                Is 1.0 a valid output from std::generate_canonical?(1.0 是 std::generate_canonical 的有效输出吗?)
                Getting big random numbers in C/C++(在 C/C++ 中获取大随机数)
                What is the best way to generate random numbers in C++?(在 C++ 中生成随机数的最佳方法是什么?)

                    <bdo id='Q6O8g'></bdo><ul id='Q6O8g'></ul>
                    <legend id='Q6O8g'><style id='Q6O8g'><dir id='Q6O8g'><q id='Q6O8g'></q></dir></style></legend>
                        <tbody id='Q6O8g'></tbody>

                      <i id='Q6O8g'><tr id='Q6O8g'><dt id='Q6O8g'><q id='Q6O8g'><span id='Q6O8g'><b id='Q6O8g'><form id='Q6O8g'><ins id='Q6O8g'></ins><ul id='Q6O8g'></ul><sub id='Q6O8g'></sub></form><legend id='Q6O8g'></legend><bdo id='Q6O8g'><pre id='Q6O8g'><center id='Q6O8g'></center></pre></bdo></b><th id='Q6O8g'></th></span></q></dt></tr></i><div id='Q6O8g'><tfoot id='Q6O8g'></tfoot><dl id='Q6O8g'><fieldset id='Q6O8g'></fieldset></dl></div>

                      <small id='Q6O8g'></small><noframes id='Q6O8g'>

                    • <tfoot id='Q6O8g'></tfoot>