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. Cannot load statically-linked qoffscreen platform plugin

Cannot load statically-linked qoffscreen platform plugin

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 1.7k 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.
  • P Offline
    P Offline
    patrickkidd
    wrote on last edited by
    #1

    I am trying to load the offscreen plugin from a statically linked Qt application. The qcocoa plugin loads fine and both static plugin libs are successfully linked into the app> But when I set QT_QPA_PLATFORM=offscreen in the environment, I get this:

    kernel/qguiapplication.cpp:1199:void init_platform(const QString &, const QString &, const QString &, int &, char **)(): Could not find the Qt platform plugin "offscreen" in ""
    
    kernel/qguiapplication.cpp:1223:void init_platform(const QString &, const QString &, const QString &, int &, char **)(): This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Available platform plugins are: cocoa.
    

    FWIW, my python unit tests are stalling somewhere in my own C++ code when I set QT_QPA_PLUGIN=offscreen and I am trying to debug it in my Xcode project which is generated via qmake target, which is set up as a static app.

    https://alaskafamilysystems.com/

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #7

      @patrickkidd said in Cannot load statically-linked qoffscreen platform plugin:

      Maybe you have to explicitly register the plugin

      Why not try out and follow the instructions: https://doc.qt.io/qt-5/plugins-howto.html#static-plugins

      "qmake automatically adds the plugins to QTPLUGIN that are typically needed by the Qt modules used (see QT), while more specialized plugins need to be added manually. The default list of automatically added plugins can be overridden per type. For example, to link the minimal plugin instead of the default Qt platform adaptation plugin, use:"

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

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

        Hi,

        Did you build the offscreen plugin as part of Qt's build ?

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

        P 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Did you build the offscreen plugin as part of Qt's build ?

          P Offline
          P Offline
          patrickkidd
          wrote on last edited by
          #3

          @SGaist said in Cannot load statically-linked qoffscreen platform plugin:

          Hi,

          Did you build the offscreen plugin as part of Qt's build ?

          libqoffscreen.a linked successfully into the app binary. Unless you are referring to some other build option.

          https://alaskafamilysystems.com/

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

            I meant: did you enable the offscreen plugin when building your static Qt ? Or did you compile it afterward ?

            Right now I am not sure whether it's built by default.

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

            P 1 Reply Last reply
            0
            • SGaistS SGaist

              I meant: did you enable the offscreen plugin when building your static Qt ? Or did you compile it afterward ?

              Right now I am not sure whether it's built by default.

              P Offline
              P Offline
              patrickkidd
              wrote on last edited by
              #5

              @SGaist said in Cannot load statically-linked qoffscreen platform plugin:

              I meant: did you enable the offscreen plugin when building your static Qt ? Or did you compile it afterward ?

              Right now I am not sure whether it's built by default.

              The static plying was built along with the rest of qt.

              https://alaskafamilysystems.com/

              P 1 Reply Last reply
              0
              • P patrickkidd

                @SGaist said in Cannot load statically-linked qoffscreen platform plugin:

                I meant: did you enable the offscreen plugin when building your static Qt ? Or did you compile it afterward ?

                Right now I am not sure whether it's built by default.

                The static plying was built along with the rest of qt.

                P Offline
                P Offline
                patrickkidd
                wrote on last edited by
                #6

                @patrickkidd said in Cannot load statically-linked qoffscreen platform plugin:

                @SGaist said in Cannot load statically-linked qoffscreen platform plugin:

                I meant: did you enable the offscreen plugin when building your static Qt ? Or did you compile it afterward ?

                Right now I am not sure whether it's built by default.

                The static plying was built along with the rest of qt.

                Maybe you have to explicitly register the plugin when it is linked statically, and the default plugin is registered by default?

                https://alaskafamilysystems.com/

                1 Reply Last reply
                0
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  @patrickkidd said in Cannot load statically-linked qoffscreen platform plugin:

                  Maybe you have to explicitly register the plugin

                  Why not try out and follow the instructions: https://doc.qt.io/qt-5/plugins-howto.html#static-plugins

                  "qmake automatically adds the plugins to QTPLUGIN that are typically needed by the Qt modules used (see QT), while more specialized plugins need to be added manually. The default list of automatically added plugins can be overridden per type. For example, to link the minimal plugin instead of the default Qt platform adaptation plugin, use:"

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

                  P 1 Reply Last reply
                  1
                  • Christian EhrlicherC Christian Ehrlicher

                    @patrickkidd said in Cannot load statically-linked qoffscreen platform plugin:

                    Maybe you have to explicitly register the plugin

                    Why not try out and follow the instructions: https://doc.qt.io/qt-5/plugins-howto.html#static-plugins

                    "qmake automatically adds the plugins to QTPLUGIN that are typically needed by the Qt modules used (see QT), while more specialized plugins need to be added manually. The default list of automatically added plugins can be overridden per type. For example, to link the minimal plugin instead of the default Qt platform adaptation plugin, use:"

                    P Offline
                    P Offline
                    patrickkidd
                    wrote on last edited by
                    #8

                    @Christian-Ehrlicher said in Cannot load statically-linked qoffscreen platform plugin:

                    @patrickkidd said in Cannot load statically-linked qoffscreen platform plugin:

                    Maybe you have to explicitly register the plugin

                    Why not try out and follow the instructions: https://doc.qt.io/qt-5/plugins-howto.html#static-plugins

                    "qmake automatically adds the plugins to QTPLUGIN that are typically needed by the Qt modules used (see QT), while more specialized plugins need to be added manually. The default list of automatically added plugins can be overridden per type. For example, to link the minimal plugin instead of the default Qt platform adaptation plugin, use:"

                    Adding QTPLUGIN.platforms += qoffscreen made QT_QPA_PLATFORM=offscreen work. Thanks!

                    Now on to all the other problems running my code in offscreen mode...

                    https://alaskafamilysystems.com/

                    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