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

error: 'GetDpiForWindow' was not declared in this scope #21

Open
AhsanSarwar45 opened this issue Sep 28, 2022 · 1 comment
Open

error: 'GetDpiForWindow' was not declared in this scope #21

AhsanSarwar45 opened this issue Sep 28, 2022 · 1 comment

Comments

@AhsanSarwar45
Copy link

AhsanSarwar45 commented Sep 28, 2022

I get multiple compiler errors like this using Windows 10 Version 10.0.19043 Build 19043.
Tried both GCC 11.2 and Clang 13.0. Any ideas on what the issue might be?

[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp: In member function 'bool xwin::Window::create(const xwin::WindowDesc&, xwin::EventQueue&)':
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp:113:48: error: 'SetThreadDpiAwarenessContext' was not declared in this scope
[build]   113 |     DPI_AWARENESS_CONTEXT previousDpiContext = SetThreadDpiAwarenessContext(
[build]       |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp:144:20: error: 'GetDpiForWindow' was not declared in this scope; did you mean 'GetTopWindow'?
[build]   144 |         int iDpi = GetDpiForWindow(hwnd);
[build]       |                    ^~~~~~~~~~~~~~~
[build]       |                    GetTopWindow
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp: In member function 'float xwin::Window::getDpiScale() const':
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32Window.cpp:236:22: error: 'GetDpiForWindow' was not declared in this scope; did you mean 'GetTopWindow'?
[build]   236 |     int currentDpi = GetDpiForWindow(hwnd);
[build]       |                      ^~~~~~~~~~~~~~~
[build]       |                      GetTopWindow
[build] [2/4  50% :: 6.310] Building CXX object Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj
[build] FAILED: Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj 
[build] D:\Apps\msys2\mingw64\bin\x86_64-w64-mingw32-g++.exe -DXWIN_WIN32=1 -IG:/Dev/RenderingEngine/Vendor/CrossWindow/src -g -std=c++14 -MD -MT Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj -MF Vendor\CrossWindow\CMakeFiles\CrossWindow.dir\src\CrossWindow\Win32\Win32EventQueue.cpp.obj.d -o Vendor/CrossWindow/CMakeFiles/CrossWindow.dir/src/CrossWindow/Win32/Win32EventQueue.cpp.obj -c G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32EventQueue.cpp
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32EventQueue.cpp: In member function 'LRESULT xwin::EventQueue::pushEvent(MSG, xwin::Window*)':
[build] G:/Dev/RenderingEngine/Vendor/CrossWindow/src/CrossWindow/Win32/Win32EventQueue.cpp:758:28: error: 'GetDpiForWindow' was not declared in this scope; did you mean 'GetTopWindow'?
[build]   758 |                 int iDpi = GetDpiForWindow(window->hwnd);
[build]       |                            ^~~~~~~~~~~~~~~
[build]       |                            GetTopWindow
@alienself
Copy link

Same here :(

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

2 participants