compiling WinXP-compliant programs in VS2012
VS2012 is not compatible with Windows XP by default, and compiled linked programs can only run on Windows Vista and above versions of the operating system. But sometimes you need to run on Windows XP and have to use VS2012 (for example, C++11 <thread>, and so on). At this time, the worry. It doesn't matter, this problem can be handled.
First, your VS2012 must be upgraded to update 3, otherwise WinXP compatible programs cannot be compiled. in the VS2012 integrated development Environment
When compiling the project, the solution manager on the left side of VS2012 is right-click, click Properties in the right-click menu, and then locate platform toolset in the-> General option of the configuration properties, and select Visual Studio 2012-windows in the Drop-down menu XP (V110_XP) option, click OK.
at the command prompt
So, what if I'm compiling on the command line? Never mind, find the command-line arguments for this Visual Studio 2012-windows XP (V110_XP) option.
Compile parameters: /d _using_v110_sdk71
CONSOLE subsystem link parameters: /subsystem:console, "5.01"
Windows Subsystem link parameters: / Subsystem:windows, "5.01"
It's OK to know these three parameters.
such as compiling boost libraries
In Tools\build\v2\engine\build.jam file, find-subsystem console, appear two times, all changed to-subsystem console, "5.01"
Then in the Tools\build\v2\tools\msvc.jam file, in the # 8.0 and above adds some more options. Then add this line:
Toolset.flags $ (toolset). Compile defines: _using_v110_sdk71_
Find these two lines again:
Toolset.flags msvc linkflags <user-interface>console:/subsystem:console;
Toolset.flags msvc linkflags <user-interface>gui:/subsystem:windows;
Change the/subsystem:console to/subsystem:console, "5.01", and/subsystem:windows to/subsystem:windows, "5.01", you can start compiling.
such as compiling QT libraries
The two lines are found in the qtbase\mkspecs\win32-msvc2012\qmake.conf file:
Qmake_lflags_console =/subsystem:console
qmake_lflags_windows =/subsystem:windows
The/subsystem:console parameter in the Qmake_lflags_console parameter is changed to/subsystem:console, "5.01", and the/subsystem in Qmake_lflags_windows: WINDOWS parameters are changed to/subsystem:windows, "5.01".
And then we'll find these two lines.
Qmake_cflags =-nologo-zm200-zc:wchar_t-
Qmake_cxxflags = $ $QMAKE _cflags
Add/D _using_v110_sdk71 in both Qmake_cflags and qmake_cxxflags, and then you can start compiling the QT library.