Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CMake+MXE+Qt for static cross compiling. How do we add plugins statically?
Qt 6.12 LTS is out! See what's new in the release blog

CMake+MXE+Qt for static cross compiling. How do we add plugins statically?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 2.2k Views 2 Watching
  • 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.
  • S Offline
    S Offline
    SamerAfach
    wrote on last edited by SamerAfach
    #1

    We're moving from qmake to cmake in this project. Everything seems to be fine and we built successfully on Linux and Windows (mac will come later). When I run the produced Windows executable, I get this error:

    qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    

    Notice that it doesn't mention what plugin is missing.

    You can see the current cmake file here, and the qmake file that has the same settings here. This qmake file is included in the main qmake file in the root directory of the repo.

    The compilation for Windows uses a cross-compiler called MXE. We do a full static build normally.

    If you wanna compile the project with MXE, note that curl has to have gnutls disabled with --without-gnutls in MXE when compiling MXE, otherwise it conflicts with OpenSSL.

    So my question is: How do I include the plugins from qmake file in the cmake file statically? Also how do I include standard Qt plugins, that will make it work?

    The error message doesn't seem to say what plugin is missing.

    If you require any additional information, let me know.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Could be related to QTBUG-38913. See the patches associated with it.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SamerAfach
        wrote on last edited by SamerAfach
        #3

        Thank you @SGaist . The versions seem pretty off for the patches. MXE uses Qt 5.11.2 currently. Also not sure this will work with MXE.

        The issue has been open for 5 years! Is there any hope for this to get solved without me patching systems manually?

        Of course all this assumes this is the issue causing the problem. Still not sure. The biggest problem there is that the error doesn't show what plugin is causing the issue.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It's a work in progress so the problem is being fixed.

          As the error states: it can find the windows backend and the list of available plugins is empty.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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
          • Unsolved