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. <Static build> qt.qpa.plugin: Could not find or load the Qt platform plugin "windows" in ""

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 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.
  • N Offline
    N Offline
    Nanda1605
    wrote on last edited by
    #1

    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

    JonBJ 1 Reply Last reply
    0
    • N Nanda1605

      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

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

      @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
      1
      • JonBJ JonB

        @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 Offline
        N Offline
        Nanda1605
        wrote on last edited by
        #3

        @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
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          0
          • SGaistS SGaist

            Hi,

            It's an environment variable.

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

            N Offline
            N Offline
            Nanda1605
            wrote on last edited by Nanda1605
            #5

            @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
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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
              0
              • SGaistS SGaist

                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 ?

                N Offline
                N Offline
                Nanda1605
                wrote on last edited by Nanda1605
                #7

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

                • Login

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