QT5.6.3+vs2017编译可以在xp下运行的程序

在pro文件中,添加如下:

win32 {
    QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
    QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
    DEFINES += _ATL_XP_TARGETING
    QMAKE_CFLAGS += /D_USING_V120_SDK71_
    QMAKE_CXXFLAGS += /D_USING_V120_SDK71_
    LIBS += -L$$quote(C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib)
    NCLUDEPATH += $$quote(C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include)
    QMAKE_TARGET_OS = xp
}

编译即可

你可能感兴趣的:(QT,qt,c++)