Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved <Static build> qt.qpa.plugin: Could not find or load the Qt platform plugin "windows" in ""

    General and Desktop
    3
    7
    651
    Loading More Posts
    • 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.
    • N
      Nanda1605 last edited by

      Hi,
      I would like to statically link a QT program in Microsoft Visual C ++ 64Bit. For this I have compiled the QT library statically. There are no issue when I compile my application but when start a program, I get the 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
      

      I searched couple of post and tried but nothing helped me out. Like below

      • I have already linked almost all of the .libraries
      • Link error when i add as Q_IMPORT_PLUGIN in main.cpp
      • included Qt5PlatformCompositorSupport.lib (as i didnt find the Qt5PlatformSupport.lin)

      PS:
      *I tested the dynamic version and it works:
      *Using CMAKE file to compile the application

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @Nanda1605 last edited by

        @Nanda1605
        Set environment variable QT_DEBUG_PLUGINS=1 and then run your application. Look at the end of the long output you should get for why it gives you your error message.

        N 1 Reply Last reply Reply Quote 1
        • N
          Nanda1605 @JonB last edited by

          @JonB
          I did, set the variable in cmake as below but I dont see any new lines of error , it still shows the same. I also set the plugin variable

          set(QT_QPA_PLATFORM_PLUGIN_PATH "C:\\QtStatic\\Qt5132\\plugins\\platforms")
          set(QT_PLUGIN_PATH "C:\\QtStatic\\Qt5132\\plugins")
          Set(QT_DEBUG_PLUGINS 1)
          
          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Hi,

            It's an environment variable.

            You have to set it in our IDE or the terminal you are using before starting your application.

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

            N 1 Reply Last reply Reply Quote 0
            • N
              Nanda1605 @SGaist last edited by Nanda1605

              @SGaist
              I configured that in the environmental variable and started the application. This time i face the same error but with the path

              C:\test\QTStatic\attunesoftware\FwUpdater\FWUtility\FirmwareUpdaterUtility\release>FwUtility.exe
              qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "C:\QtStatic\Qt5132\plugins\platforms"
              This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
              

              PS: Also i tried the path as below but didnt work. And in this location C:\QtStatic\Qt5132\plugins\platforms - i have qwindows.lib file

              • C:\QtStatic\Qt5132\plugins
              • C:\QtStatic\Qt5132
              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                I just realised: you are supposed to have a static Qt build, the plugins should be built-in. If that not the case then you likely have an issue with your build.

                On maybe silly question, did you call make install after you built Qt ?

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

                N 1 Reply Last reply Reply Quote 0
                • N
                  Nanda1605 @SGaist last edited by Nanda1605

                  @SGaist
                  I built QT as static with the required configuration. I could see the below files in platform plugins

                  • qwindows.lib
                  • qwindows.prl
                  • qminimal.lib
                  • qminimal.prl
                  • qdirect. qoffscreen... qwebgl

                  After build I use cmake install command to install the application.
                  Still not resolved

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post