can msvc application depended on sdk 7.1A run on windows XP sp3?

gy l 1 Reputation point
2021-08-07T15:13:24.513+00:00

compiled env: vs 2013 + sdk 7.1A + platform toolset v120_xp.
run on windows xp sp3 , got errors as follows:
121330-image.png

121317-image.png

Windows development | Windows API - Win32
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 49,636 Reputation points
    2021-08-07T20:11:24.29+00:00

    I only understand English but I'm guessing that your code fails on Windows XP sp3 because it is attempting to use functions that were introduced in Windows Vista. When you build to Target windows XP sp3 you must properly define _WIN32_WINNT before including any sdk headers. Refer to using-the-windows-headers

    For example,

    #define NTDDI_VERSION NTDDI_WINXPSP3  
    #define _WIN32_WINNT _WIN32_WINNT_WINXP  
    #include <Windows.h>  
      
      
    

    After properly targeting for Windows XPSP3 any code attempting to use functions that were not available until later versions of Windows will now cause compilation errors. So it will be necessary to find alternate solutions that are available in the version of Windows that is targeted.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.