Seems I have found a solution.I print these variables out and I found the Microsoft Official solution is not suitable for me.On my computer the matched directory's name is v7.1A,not 7.1A. And after I finished set vsvars32.bat I found there is no variable named "CL",so I just set CL equal to /D_USING_V110_SDK71_.Following is my solution.
Step1:
set vcvars32.bat
Step2:
set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE%
set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Lib;%LIB%
set CL=/D_USING_V110_SDK71_
set LINK=/SUBSYSTEM:CONSOLE,5.01
Here are some references.
How to target XP with VC2012 or VC2013 and continue to use the Windows 8.x SDK | Ted's Blog[
^]
Windows XP Targeting with C++ in Visual Studio 2012 | Visual C++ Team Blog[
^]
Sorry for my poor english,hope this solution is helpful.