Skip to content

Broken Compilation Using WinSDK pre-v10 #5147

@NicksWorld

Description

@NicksWorld

The dependence on DbgHelp.h introduced in #5144 causes warnings that prevent compilation using older Windows SDK versions. Some versions (8.1 and earlier known) trigger warning C4091 in the header, leading to a failed build.

There are a few ways of handling this problem:

  • Ignore the warning using
#pragma warning(push)
#pragma warning(disable:4091)
#include <DbgHelp.h>
#pragma warning(pop)
  • Setting an SDK version dependency of 10+, which may break compatibility with older versions of Windows. Cmake provides ways of configuring this if desirable.

Relevant discussion: https://discordapp.com/channels/793331351645323264/1046628873397358602/1322529161407102987

Error:

73>C:\Program Files (x86)\Windows Kits\8.1\Include\um\DbgHelp.h(1544,2): error C2220: the following warning is treated as an error (compiling source file C:\Users\Ryan\dfhack\library\MiscUtils.cpp)
73>C:\Program Files (x86)\Windows Kits\8.1\Include\um\DbgHelp.h(1544,2): warning C4091: 'typedef ': ignored on left of '<unnamed-enum-hdBase>' when no variable is declared (compiling source file C:\Users\Ryan\dfhack\library\MiscUtils.cpp)
73>C:\Program Files (x86)\Windows Kits\8.1\Include\um\DbgHelp.h(3190,2): warning C4091: 'typedef ': ignored on left of '<unnamed-enum-sfImage>' when no variable is declared (compiling source file C:\Users\Ryan\dfhack\library\MiscUtils.cpp)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions