Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error Win10 MinGW error: 'SM_SYSTEMDOCKED' was not declared in this scope #156

Open
sinipelto opened this issue Jul 17, 2024 · 1 comment

Comments

@sinipelto
Copy link

Describe the bug
Tried to compile on Windows 10 with MinGW64 but got this win32 api related error:

g++.exe -Wall -Wextra -Wpedantic -mwindows -o main.exe .\klog_main.cpp

.\klog_main.cpp: In function 'int Save(int)':
.\klog_main.cpp:142:46: warning: unknown conversion type character 'F' in format [-Wformat=]
142 | strftime(s, sizeof(s), "%FT%X%z", &tm_info);
| ^
.\klog_main.cpp: In function 'bool IsSystemBooting()':
.\klog_main.cpp:204:33: error: 'SM_SYSTEMDOCKED' was not declared in this scope
204 | return GetSystemMetrics(SM_SYSTEMDOCKED) != 0;

Desktop (please complete the following information):

  • OS: Windows 10 22H2 build 19045.4651

Additional context
Latest source from master => windows/klog_main.cpp

@sinipelto
Copy link
Author

As a workaround, I replaced the constant with the actual value:

return GetSystemMetrics(0x2004) != 0;

It complies well and works. However would be nice to figure out why the constant is not defined in compile time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant