Skip to content

'LIBM2K_ENABLE_LOG' error with MSVC  #333

Description

@gvanem

Enabling the -DLIBM2K_ENABLE_LOG flag, causes this compile error with MSVC-2022:

context_impl.cpp(118): error C2872: 'INPUT': ambiguous symbol
f:\gv\WinKit\Include\10.0.22621.0\um\winuser.h(6144): note: could be 'tagINPUT INPUT'
F:\gv\dx-radio\gnuradio\gv-build\include\libm2k/utils/enums.hpp(37): note: or       'libm2k::utils::DEVICE_DIRECTION INPUT'
context_impl.cpp(118): error C2275: 'INPUT': expected an expression instead of a type
context_impl.cpp(127): error C2872: 'INPUT': ambiguous symbol
...

Since <winuser.h> was pulled in via <glog/logging.h> and <windows.h>.
I fail to understand how to fix this.

Perhaps include/libm2k/utils/enums.hpp could use less universal names like m2k_INPUT etc.?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions