wangwenx190 / framelesshelper

Project moved to: https://github.com/stdware/qwindowkit Cross-platform window customization framework for Qt Widgets and Qt Quick. Supports Windows, Linux and macOS.
MIT License
846 stars 203 forks source link

CMake mingw_64 failing to build #282

Closed 2042Third closed 1 year ago

2042Third commented 1 year ago

Unable to build the library in windows 11, updated g++ and mingw dev tools.

C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:425:26: error: 'WM_NCPOINTERDOWN' was not declared in this scope
  425 |     DEFINE_WIN32_MESSAGE(WM_NCPOINTERDOWN)
      |                          ^~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:426:26: error: 'WM_NCPOINTERUP' was not declared in this scope; did you mean 'WM_NCPAINT'?
  426 |     DEFINE_WIN32_MESSAGE(WM_NCPOINTERUP)
      |                          ^~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:427:26: error: 'WM_POINTERUPDATE' was not declared in this scope
  427 |     DEFINE_WIN32_MESSAGE(WM_POINTERUPDATE)
      |                          ^~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:428:26: error: 'WM_POINTERDOWN' was not declared in this scope; did you mean 'WM_PAINTICON'?
  428 |     DEFINE_WIN32_MESSAGE(WM_POINTERDOWN)
      |                          ^~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:429:26: error: 'WM_POINTERUP' was not declared in this scope; did you mean 'E_POINTER'?
  429 |     DEFINE_WIN32_MESSAGE(WM_POINTERUP)
      |                          ^~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:430:26: error: 'WM_POINTERENTER' was not declared in this scope
  430 |     DEFINE_WIN32_MESSAGE(WM_POINTERENTER)
      |                          ^~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:431:26: error: 'WM_POINTERLEAVE' was not declared in this scope; did you mean 'WM_MOUSELEAVE'?
  431 |     DEFINE_WIN32_MESSAGE(WM_POINTERLEAVE)
      |                          ^~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:432:26: error: 'WM_POINTERACTIVATE' was not declared in this scope; did you mean 'WM_MOUSEACTIVATE'?
  432 |     DEFINE_WIN32_MESSAGE(WM_POINTERACTIVATE)
      |                          ^~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:433:26: error: 'WM_POINTERCAPTURECHANGED' was not declared in this scope; did you mean 'WM_CAPTURECHANGED'?
  433 |     DEFINE_WIN32_MESSAGE(WM_POINTERCAPTURECHANGED)
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:434:26: error: 'WM_TOUCHHITTESTING' was not declared in this scope
  434 |     DEFINE_WIN32_MESSAGE(WM_TOUCHHITTESTING)
      |                          ^~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:435:26: error: 'WM_POINTERWHEEL' was not declared in this scope; did you mean 'WM_MOUSEHWHEEL'?
  435 |     DEFINE_WIN32_MESSAGE(WM_POINTERWHEEL)
      |                          ^~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:436:26: error: 'WM_POINTERHWHEEL' was not declared in this scope; did you mean 'WM_MOUSEHWHEEL'?
  436 |     DEFINE_WIN32_MESSAGE(WM_POINTERHWHEEL)
      |                          ^~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:437:26: error: 'WM_POINTERROUTEDTO' was not declared in this scope
  437 |     DEFINE_WIN32_MESSAGE(WM_POINTERROUTEDTO)
      |                          ^~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:438:26: error: 'WM_POINTERROUTEDAWAY' was not declared in this scope
  438 |     DEFINE_WIN32_MESSAGE(WM_POINTERROUTEDAWAY)
      |                          ^~~~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:439:26: error: 'WM_POINTERROUTEDRELEASED' was not declared in this scope; did you mean 'WM_POINTERDEVICEDELETED'?
  439 |     DEFINE_WIN32_MESSAGE(WM_POINTERROUTEDRELEASED)
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:457:26: error: 'WM_DPICHANGED_BEFOREPARENT' was not declared in this scope
  457 |     DEFINE_WIN32_MESSAGE(WM_DPICHANGED_BEFOREPARENT)
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:458:26: error: 'WM_DPICHANGED_AFTERPARENT' was not declared in this scope
  458 |     DEFINE_WIN32_MESSAGE(WM_DPICHANGED_AFTERPARENT)
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:246:53: note: in definition of macro 'DEFINE_WIN32_MESSAGE'
  246 | #define DEFINE_WIN32_MESSAGE(Message) Win32Message{ Message, #Message },
      |                                                     ^~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp: In function 'bool wangwenx190::FramelessHelper::isNonClientMessage(UINT)':
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:931:29: error: 'WM_NCPOINTERUPDATE' was not declared in this scope
  931 |             || ((message >= WM_NCPOINTERUPDATE) && (message <= WM_NCPOINTERUP))
      |                             ^~~~~~~~~~~~~~~~~~
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:931:64: error: 'WM_NCPOINTERUP' was not declared in this scope; did you mean 'WM_NCPAINT'?
  931 |             || ((message >= WM_NCPOINTERUPDATE) && (message <= WM_NCPOINTERUP))
      |                                                                ^~~~~~~~~~~~~~
      |                                                                WM_NCPAINT
C:/Users/usr/Documents/framelesshelper/src/core/utils_win.cpp:937:1: warning: control reaches end of non-void function [-Wreturn-type]
  937 | }
      | ^
ninja: build stopped: subcommand failed.
2042Third commented 1 year ago

This is how I am building the library:

...
rmdir /s /q %INSTALL_PATH_% && ^
mkdir %INSTALL_PATH_% && ^
cd %INSTALL_PATH_% && ^
cmake -DCMAKE_PREFIX_PATH=%SDK_DIR_PATH%  -DCMAKE_INSTALL_PREFIX=./ -DCMAKE_BUILD_TYPE=Release -GNinja %PATH_TO_THE_REPOSITORY% && ^
cmake --build . --config Release --target all --parallel && ^
cmake --install . --config Release --strip &&^
cd ../
...

My folder structure is:

lib
├───framlesshelperBuild
├───framelesshelper

Please help. Thank you.

wangwenx190 commented 1 year ago

Your Windows SDK is too old, if you can't upgrade your Windows SDK, you can comment out all the code above, they are for debugging purpose only, it's safe to comment them out.