Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Windows compilation problem
Qt 6.11 is out! See what's new in the release blog

Windows compilation problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 545 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    oliver_mpt
    wrote on last edited by
    #1

    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 ...

    JonBJ 1 Reply Last reply
    1
    • O oliver_mpt

      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 ...

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @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.

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Philippe Cloutier
        wrote last edited by
        #3

        Thank you very much @oliver_mpt
        I get the same problem trying to compile CopyQ 14.0 against Qt 6.11.0 on Windows 11.

        Thank you very much @JonB
        I was using version 11 and tried using a newer MinGW-w64, and I managed to compile using version 14. But it fails to link. I'm too ignorant about Qt, C++ and C toolchains to judge, but there is a good chance that going from version 11 to 14 suffices to fix that specific issue. I did not need to define NTDDI_VERSION.

        Unfortunately I do not know for sure because I got version 14 from MSYS2 instead of Qt, so they're very different beasts, which is very likely to explain the linking failure.

        How were you able to get MinGW-w64 13 from Qt? One thing I noticed is it's complicated to see which version of MinGW-w64 a directory contains.

        License

        cristian-adamC 1 Reply Last reply
        0
        • P Philippe Cloutier

          Thank you very much @oliver_mpt
          I get the same problem trying to compile CopyQ 14.0 against Qt 6.11.0 on Windows 11.

          Thank you very much @JonB
          I was using version 11 and tried using a newer MinGW-w64, and I managed to compile using version 14. But it fails to link. I'm too ignorant about Qt, C++ and C toolchains to judge, but there is a good chance that going from version 11 to 14 suffices to fix that specific issue. I did not need to define NTDDI_VERSION.

          Unfortunately I do not know for sure because I got version 14 from MSYS2 instead of Qt, so they're very different beasts, which is very likely to explain the linking failure.

          How were you able to get MinGW-w64 13 from Qt? One thing I noticed is it's complicated to see which version of MinGW-w64 a directory contains.

          License

          cristian-adamC Offline
          cristian-adamC Offline
          cristian-adam
          wrote last edited by
          #4

          @Philippe-Cloutier said in Windows compilation problem:

          How were you able to get MinGW-w64 13 from Qt? One thing I noticed is it's complicated to see which version of MinGW-w64 a directory contains.

          See https://wiki.qt.io/MinGW. Qt is using binaries from https://github.com/niXman/mingw-builds-binaries/releases

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Philippe Cloutier
            wrote last edited by
            #5

            @cristian-adam: Unfortunately that page does not indicate how to get version 13 (or any other).

            Christian EhrlicherC 1 Reply Last reply
            0
            • P Philippe Cloutier

              @cristian-adam: Unfortunately that page does not indicate how to get version 13 (or any other).

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote last edited by
              #6

              @Philippe-Cloutier said in Windows compilation problem:

              Unfortunately that page does not indicate how to get version 13 (or any other).

              You did read the page, right?

              Qt 6.8.0 -> mingw-builds 13.1.0-202407240918mingw1310

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Philippe Cloutier
                wrote last edited by
                #7

                @Christian-Ehrlicher: If I hadn't read it, I would not have edited it nor created the talk page to say the table you refer to is unclear.
                However, reading a page does not necessarily involve consulting every link, downloading the linked packages and analyzing them. If you are suggesting mingw-builds 13.1.0-202407240918mingw1310 contains MinGW 13, I doubt Oliver installed Qt 6.8.0, since he does not mention it and that had been superseded a while before he posted. Qt online installer 4.11.0 is not offering me Qt 6.8.0.

                Christian EhrlicherC 1 Reply Last reply
                0
                • P Philippe Cloutier

                  @Christian-Ehrlicher: If I hadn't read it, I would not have edited it nor created the talk page to say the table you refer to is unclear.
                  However, reading a page does not necessarily involve consulting every link, downloading the linked packages and analyzing them. If you are suggesting mingw-builds 13.1.0-202407240918mingw1310 contains MinGW 13, I doubt Oliver installed Qt 6.8.0, since he does not mention it and that had been superseded a while before he posted. Qt online installer 4.11.0 is not offering me Qt 6.8.0.

                  Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote last edited by
                  #8

                  @Philippe-Cloutier Qt 6.8 -> mean Qt 6.8 and up as you can easily see from the other rows where not all Qt versions are mentioned...

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    Philippe Cloutier
                    wrote last edited by
                    #9

                    @Christian-Ehrlicher: If " ->" means "and up", that's unusual, and it means 6.11.0 would contain both mingw-builds x86_64-11.2.0-release-posix-seh-rt_v9-rev3 and mingw-builds 13.1.0-202407240918mingw1310.
                    In any case, unless you are saying that one of these contains MinGW 13, I do not see your point.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved