jay / battstatus

Monitor the Windows battery status for changes in state
Other
8 stars 1 forks source link

It cannot compile with Visual Studio 2019 #6

Closed Zero3K closed 2 years ago

Zero3K commented 2 years ago

I am getting the following errors when trying to compile it via Visual Studio 2019:

C:\battstatus>cl /W4 /wd4127 battstatus.cpp user32.lib powrprof.lib setupapi.lib Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30143 for x86 Copyright (C) Microsoft Corporation. All rights reserved.

battstatus.cpp battstatus.cpp(818): error C2039: 'Reserved1': is not a member of '_SYSTEM_POWER_STATUS' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winbase.h(7977): note: see declaration of '_SYSTEM_POWER_STATUS' battstatus.cpp(836): error C2039: 'Reserved1': is not a member of '_SYSTEM_POWER_STATUS' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winbase.h(7977): note: see declaration of '_SYSTEM_POWER_STATUS' battstatus.cpp(1246): warning C4456: declaration of 'ntstatus' hides previous local declaration battstatus.cpp(1117): note: see declaration of 'ntstatus' battstatus.cpp(1456): warning C4456: declaration of 'ntstatus' hides previous local declaration battstatus.cpp(1117): note: see declaration of 'ntstatus' battstatus.cpp(1602): error C2039: 'Reserved1': is not a member of '_SYSTEM_POWER_STATUS' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winbase.h(7977): note: see declaration of '_SYSTEM_POWER_STATUS' battstatus.cpp(1602): error C2039: 'Reserved1': is not a member of '_SYSTEM_POWER_STATUS' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winbase.h(7977): note: see declaration of '_SYSTEM_POWER_STATUS' battstatus.cpp(1604): error C2039: 'Reserved1': is not a member of '_SYSTEM_POWER_STATUS' C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winbase.h(7977): note: see declaration of '_SYSTEM_POWER_STATUS'

jay commented 2 years ago

Yes it's probably SystemStatusFlag which used to be named Reserved1. I'll look into it.