Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. This application failed to start because no Qt platform plugin could be initialized!

This application failed to start because no Qt platform plugin could be initialized!

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
11 Posts 3 Posters 40.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.
  • J Offline
    J Offline
    JohnDaYe
    wrote on 30 Jan 2019, 13:13 last edited by JohnDaYe
    #1

    i extract qt 5.12.0 src to two dirs (debug release), the debug dir is to build debug library, relesase dir is to build release library, when i complie success, i nmake install debug dir's library to dir A,then nmake install release dir's library to dir A, finally i copy the dir A to ohter machine.
    i create a project by qtcreator and complie it with Qt build by myself, when i run it by qt creator, it will crash in debug mode:
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    release is ok!

    qt.conf

    [Paths]
    Prefix=..

    debug lib configue params:
    configure -confirm-license -opensource -platform win32-msvc -debug -shared -force-debug-info -angle -opengl dynamic -prefix "E:\Library\Qt5.12.0_VS2017_VCLTL" -qt-sqlite -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -ssl -openssl-linked -nomake tests -no-compile-examples -nomake examples -nomake tools -IE:\Library\OpenSSL\include -LE:\Library\OpenSSL\libd

    K 1 Reply Last reply 30 Jan 2019, 13:24
    0
    • J JohnDaYe
      30 Jan 2019, 13:13

      i extract qt 5.12.0 src to two dirs (debug release), the debug dir is to build debug library, relesase dir is to build release library, when i complie success, i nmake install debug dir's library to dir A,then nmake install release dir's library to dir A, finally i copy the dir A to ohter machine.
      i create a project by qtcreator and complie it with Qt build by myself, when i run it by qt creator, it will crash in debug mode:
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      release is ok!

      qt.conf

      [Paths]
      Prefix=..

      debug lib configue params:
      configure -confirm-license -opensource -platform win32-msvc -debug -shared -force-debug-info -angle -opengl dynamic -prefix "E:\Library\Qt5.12.0_VS2017_VCLTL" -qt-sqlite -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -ssl -openssl-linked -nomake tests -no-compile-examples -nomake examples -nomake tools -IE:\Library\OpenSSL\include -LE:\Library\OpenSSL\libd

      K Offline
      K Offline
      koahnig
      wrote on 30 Jan 2019, 13:24 last edited by
      #2

      @JohnDaYe

      You do not have to split Qt source into a debug and a release folder for compilation. The standard is that both are compiled in one configure and make run at once. In creator you can select either debug or release with the same qmake.

      In your case you would need two different qmake. Each qmake defines what is called a different tool chain. With one tool chain you can compile and debug. When you like to have a release version of your application you need to change the tool.

      Vote the answer(s) that helped you to solve your issue(s)

      J 1 Reply Last reply 30 Jan 2019, 13:30
      0
      • K koahnig
        30 Jan 2019, 13:24

        @JohnDaYe

        You do not have to split Qt source into a debug and a release folder for compilation. The standard is that both are compiled in one configure and make run at once. In creator you can select either debug or release with the same qmake.

        In your case you would need two different qmake. Each qmake defines what is called a different tool chain. With one tool chain you can compile and debug. When you like to have a release version of your application you need to change the tool.

        J Offline
        J Offline
        JohnDaYe
        wrote on 30 Jan 2019, 13:30 last edited by
        #3

        @koahnig
        can i copy The standard's toolchain exe replace my build version?

        i must split my qt souce to debug and release because VC-LTL

        K 1 Reply Last reply 30 Jan 2019, 13:38
        0
        • J JohnDaYe
          30 Jan 2019, 13:30

          @koahnig
          can i copy The standard's toolchain exe replace my build version?

          i must split my qt souce to debug and release because VC-LTL

          K Offline
          K Offline
          koahnig
          wrote on 30 Jan 2019, 13:38 last edited by
          #4

          @JohnDaYe said in This application failed to start because no Qt platform plugin could be initialized!:

          @koahnig
          can i copy The standard's toolchain exe replace my build version?

          The compiled qmake.exe and the built Qt libs are somewhat one unit. The generated qmake holds some important information of the configuration and setup. AFAIK you cannot copy them over to another tool chain.

          i must split my qt souce to debug and release because VC-LTL

          Do not know anything about this. However, this sounds strange to me.

          Vote the answer(s) that helped you to solve your issue(s)

          J 3 Replies Last reply 30 Jan 2019, 14:00
          0
          • K koahnig
            30 Jan 2019, 13:38

            @JohnDaYe said in This application failed to start because no Qt platform plugin could be initialized!:

            @koahnig
            can i copy The standard's toolchain exe replace my build version?

            The compiled qmake.exe and the built Qt libs are somewhat one unit. The generated qmake holds some important information of the configuration and setup. AFAIK you cannot copy them over to another tool chain.

            i must split my qt souce to debug and release because VC-LTL

            Do not know anything about this. However, this sounds strange to me.

            J Offline
            J Offline
            JohnDaYe
            wrote on 30 Jan 2019, 14:00 last edited by
            #5

            @koahnig
            i can build my test project with my build version, only the problem is i can not run it by qt creator or Visual studio, but i can use windeployqt to copy dll to my project build path, i works fine
            if i build my test project with standard ver , i it is not need to copy dll when i run it by vs or qt creator

            1 Reply Last reply
            0
            • K koahnig
              30 Jan 2019, 13:38

              @JohnDaYe said in This application failed to start because no Qt platform plugin could be initialized!:

              @koahnig
              can i copy The standard's toolchain exe replace my build version?

              The compiled qmake.exe and the built Qt libs are somewhat one unit. The generated qmake holds some important information of the configuration and setup. AFAIK you cannot copy them over to another tool chain.

              i must split my qt souce to debug and release because VC-LTL

              Do not know anything about this. However, this sounds strange to me.

              J Offline
              J Offline
              JohnDaYe
              wrote on 30 Jan 2019, 14:04 last edited by
              #6

              @koahnig wait for me, i can resolve it! i will post my method, wait 4 me

              1 Reply Last reply
              0
              • K koahnig
                30 Jan 2019, 13:38

                @JohnDaYe said in This application failed to start because no Qt platform plugin could be initialized!:

                @koahnig
                can i copy The standard's toolchain exe replace my build version?

                The compiled qmake.exe and the built Qt libs are somewhat one unit. The generated qmake holds some important information of the configuration and setup. AFAIK you cannot copy them over to another tool chain.

                i must split my qt souce to debug and release because VC-LTL

                Do not know anything about this. However, this sounds strange to me.

                J Offline
                J Offline
                JohnDaYe
                wrote on 30 Jan 2019, 14:23 last edited by JohnDaYe
                #7

                @koahnig
                i do a test
                i copy a standard ver install by offical installer from dir A to dir B, i build my test project with B, i can run my exe by qt creator,but i rename dia A to C, i build my test project with B, it can't run by qt creator!

                so i think installer will do something what i do not know!

                1 Reply Last reply
                0
                • H Online
                  H Online
                  hskoglund
                  wrote on 30 Jan 2019, 15:59 last edited by
                  #8

                  Sure, the Qt installer "burns" the path to dir A into Qt5Core.dll, for example if I open my Qt5Core.dll I can see
                  qt_prfxpath=C:\Qt\5.12.0\msvc2017 inside it.

                  If that qt_prfxpath is pointing to a non-existent directory then you will get that platform plugin error. One way out of this problem is to run windeployqt on your .exe file, when it copies the necessary Qt .dll files it will also neuter that path (i.e. that copy will read): qt_prfxpath=.

                  This will instead make Qt look for the platforms subdirectory in the same place as the .exe file.

                  J 1 Reply Last reply 30 Jan 2019, 22:11
                  2
                  • H hskoglund
                    30 Jan 2019, 15:59

                    Sure, the Qt installer "burns" the path to dir A into Qt5Core.dll, for example if I open my Qt5Core.dll I can see
                    qt_prfxpath=C:\Qt\5.12.0\msvc2017 inside it.

                    If that qt_prfxpath is pointing to a non-existent directory then you will get that platform plugin error. One way out of this problem is to run windeployqt on your .exe file, when it copies the necessary Qt .dll files it will also neuter that path (i.e. that copy will read): qt_prfxpath=.

                    This will instead make Qt look for the platforms subdirectory in the same place as the .exe file.

                    J Offline
                    J Offline
                    JohnDaYe
                    wrote on 30 Jan 2019, 22:11 last edited by JohnDaYe
                    #9

                    @hskoglund thanks
                    i can change it in qt5cored.dll by winhex or make a tool to do this
                    only debug dll need do this

                    K 1 Reply Last reply 31 Jan 2019, 07:43
                    0
                    • J JohnDaYe
                      30 Jan 2019, 22:11

                      @hskoglund thanks
                      i can change it in qt5cored.dll by winhex or make a tool to do this
                      only debug dll need do this

                      K Offline
                      K Offline
                      koahnig
                      wrote on 31 Jan 2019, 07:43 last edited by
                      #10

                      @JohnDaYe

                      Certainly a way to change the name.

                      However, IMHO you will spend a couple of month until you get the stuff to work. There has been a Qt tool in the far past that allowed changing the location of Qt libs afterwards. Haven't read of it for long. Might have been even Qt4.
                      The online installer makes things mauch easier.

                      IMHO you shold check if you really have to separate in debug and release folders for Qt.

                      Why are you refering directly to VCLTL when configuring Qt?
                      Libraries shall be independent enough or at least Qt libs shall be the basis to be used when the other lib is compiled.
                      When VCLTL requires the other way around you should check there for help.

                      Vote the answer(s) that helped you to solve your issue(s)

                      J 1 Reply Last reply 1 Feb 2019, 12:25
                      0
                      • K koahnig
                        31 Jan 2019, 07:43

                        @JohnDaYe

                        Certainly a way to change the name.

                        However, IMHO you will spend a couple of month until you get the stuff to work. There has been a Qt tool in the far past that allowed changing the location of Qt libs afterwards. Haven't read of it for long. Might have been even Qt4.
                        The online installer makes things mauch easier.

                        IMHO you shold check if you really have to separate in debug and release folders for Qt.

                        Why are you refering directly to VCLTL when configuring Qt?
                        Libraries shall be independent enough or at least Qt libs shall be the basis to be used when the other lib is compiled.
                        When VCLTL requires the other way around you should check there for help.

                        J Offline
                        J Offline
                        JohnDaYe
                        wrote on 1 Feb 2019, 12:25 last edited by
                        #11

                        @koahnig
                        VCLTL can let my qt program run with out VC run time
                        VC Runtime is terrible now!

                        1 Reply Last reply
                        0

                        9/11

                        30 Jan 2019, 22:11

                        • Login

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