aaronmjacobs/Boxer

warning C4005: 'WIN32_LEAN_AND_MEAN': macro redefinition

Closed this issue · 3 comments

Visual Studio 2022 with pedantic warnings level

Compiling with /Wall using the latest version of Visual Studio 2022 (17.2.1), the only warning I see is C5039 (which comes from Windows.h). What compiler version are you seeing the warning on?

I'm compiling with the same compiler, but I have CMake globally enabled

  # Base Windows platform
  add_definitions(-DWIN32 -DWIN32_LEAN_AND_MEAN)

  set(CMAKE_C_FLAGS "/W4 /WX")
  set(CMAKE_CXX_FLAGS "/W4 /WX")

  # Module subdirectory
  add_subdirectory("Boxer")

The problem is that I have WIN32_LEAN_AND_MEAN before it's defined in your boxer_win.cpp and I also have pedantic warnings level (/W4) with treat warnings as error option (/WX).

As the result I have macro redefinition issue in pedantic mode: warning C4005: 'WIN32_LEAN_AND_MEAN': macro redefinition

Fair enough!