How to compile for windows XP?

rain 41 Reputation points
2023-01-22T14:34:19.36+00:00

Hi!

How do I compile my code for Windows XP?

I found this tutorial here:
https://learn.microsoft.com/en-us/cpp/build/configuring-programs-for-windows-xp?view=msvc-170&source=docs

It says:

To target Windows XP

    In Solution Explorer, open the shortcut menu for your project, and then choose Properties.

    In the Property Pages dialog box for the project, set the Configuration dropdown to All configurations.

    Select the Configuration Properties > General property page. Set the Platform Toolset property to your preferred Windows XP toolset. For example, choose Visual Studio 2017 - Windows XP (v141_xp) to create code for Windows XP and Windows Server 2003 by using the Microsoft C++ compiler from Visual Studio 2017.

I don't have this Configuration Properties > General here:
User's image

What do I do wrong?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,515 questions
{count} votes

Accepted answer
  1. RLWA32 39,451 Reputation points
    2023-01-22T15:15:15.07+00:00

    The problem is that you haven't gone to the property page for the C++ project. What you are showing is a property page for the Solution.

    Wrong Property Page Selection for Solution -

    WrongSelection

    Correct Property Page Selection for Project -

    CorrectSelection

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. RLWA32 39,451 Reputation points
    2023-01-22T17:51:39.4466667+00:00

    The documentation at https://learn.microsoft.com/en-us/cpp/build/configuring-programs-for-windows-xp?view=msvc-170&source=docs says "The toolset supplied in Visual Studio 2019 and later doesn't include support for creating code for Windows XP. Support for Windows XP development is available by using the Visual Studio 2017 v141_xp toolset. You can install the v141_xp toolset as an individual component option in the Visual Studio Installer."

    So you should install that support in your copy of VS2022.

    For example, adding to VS2017 toolset and XP support using the Visual Studio Installer -

    VS2017Toolset

    I wasn't sure if the XP support could be installed without the VS2017 v141 toolset so I installed both.

    Hello World C++ project property page showing use of v141_xp toolset -

    XPToolsetSelected

    1 person found this answer helpful.
    0 comments No comments