Windows compilation problem
-
Hello,
I have been using Qt for a long time now, but not for windows. I tried to recompile one of my apps (working well with linux and MacOS) for windows, so I configured a kit with Qt 6.5 LTS and MinGW (tried both MinGW11 and 13 that were installed by the Qt installation tool).
I get errors like "variable CreateSyntheticPointerDevice definition is marked as dllimport" and the likes, several times. I spent some time looking on internet and trying to understand and decided to simplyfy the problem by generating a new empty Qt project, and I get the same compilation errors.
The function CreateSyntheticPointerDevice is declared in winuser.h as :
WINUSERAPI HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice( ....)
Other functions marked as WINUSERAPI WINAPI does not seem to be problematic, so the problem could be linked to the HSYNTHETICPOINTERDEVICE marking.
I don't know how to fix this, any help greatly appreciated ... -
Hello,
I have been using Qt for a long time now, but not for windows. I tried to recompile one of my apps (working well with linux and MacOS) for windows, so I configured a kit with Qt 6.5 LTS and MinGW (tried both MinGW11 and 13 that were installed by the Qt installation tool).
I get errors like "variable CreateSyntheticPointerDevice definition is marked as dllimport" and the likes, several times. I spent some time looking on internet and trying to understand and decided to simplyfy the problem by generating a new empty Qt project, and I get the same compilation errors.
The function CreateSyntheticPointerDevice is declared in winuser.h as :
WINUSERAPI HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice( ....)
Other functions marked as WINUSERAPI WINAPI does not seem to be problematic, so the problem could be linked to the HSYNTHETICPOINTERDEVICE marking.
I don't know how to fix this, any help greatly appreciated ...@oliver_mpt said in Windows compilation problem:
The function CreateSyntheticPointerDevice is declared in winuser.h as :
I don't know but have a read through https://www.reddit.com/r/gcc/comments/u0q721/how_to_compile_a_shared_library_that_uses_types/ . That was from 3 years ago and said
You'll need a very recent version of Mingw-w64. You'll also need to define NTDDI_VERSION to at least NTDDI_WIN10_RS5
Maybe the discussion there will help for this particular issue? Also https://discuss.kde.org/t/kirigami2-for-developement-on-windows-rant/6333/16.
If the error comes from Qt sources rather than your own I do not know why it does not run through and compile/link correctly. I do not use Windows for Qt.