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. Cannot run program after deployment
Forum Updated to NodeBB v4.3 + New Features

Cannot run program after deployment

Scheduled Pinned Locked Moved Solved Installation and Deployment
4 Posts 2 Posters 582 Views 1 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.
  • M Offline
    M Offline
    maydin
    wrote on last edited by
    #1

    I wrote a program in Linux then I copied files to Windows Qt environment. I compiled program in Release mode from Qt Creator itself and it worked well.

    Then I copied its executable to a folder. Copied all DLLs and deleted while program is running. Now I got DLLs I need.

    Again tested, my program is working well. Now changed name of Qt directory on my system. It does not work. Gives me this error:
    This application failed to start because no Qt platform plugin could be initialized.

    Now created a folder there and named "platforms". Copied everything inside platforms of mingw plugins.

    Now my program does not give that error but it does not start either.

    I am using Qt 5.11.2 with default minGW compiler. I used "quick, sql, quickcontrols2" modules (These are included in my .pro file)

    raven-worxR 1 Reply Last reply
    0
    • M maydin

      I wrote a program in Linux then I copied files to Windows Qt environment. I compiled program in Release mode from Qt Creator itself and it worked well.

      Then I copied its executable to a folder. Copied all DLLs and deleted while program is running. Now I got DLLs I need.

      Again tested, my program is working well. Now changed name of Qt directory on my system. It does not work. Gives me this error:
      This application failed to start because no Qt platform plugin could be initialized.

      Now created a folder there and named "platforms". Copied everything inside platforms of mingw plugins.

      Now my program does not give that error but it does not start either.

      I am using Qt 5.11.2 with default minGW compiler. I used "quick, sql, quickcontrols2" modules (These are included in my .pro file)

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @maydin
      http://doc.qt.io/qt-5/windows-deployment.html

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maydin
        wrote on last edited by maydin
        #3

        @raven-worx Yes, I have already read that but I saw like this in tutorials that I found in internet. Probably they are outdated since Qt is evolving.

        Finally I decided to do it like in official instructions. First I tried to use windeployqt tool on executable created by QtCreator, but it didn't work.

        Then I used these commands on folder where PRO file exists:

        qmake -config release
        qmake project.pro
        mingw32-make
        windeployqt Project.exe
        

        And it works.

        But I have a question. There are folders like translations etc. I didn't configure something for translations but they are still there. I think they are useless. I opened program and tried to delete everything while running. Some of them are deleted, at the end size of folder became around 40 mb from 70 mbs.

        Does this cause problems later? Because I am not sure about how it works.

        raven-worxR 1 Reply Last reply
        0
        • M maydin

          @raven-worx Yes, I have already read that but I saw like this in tutorials that I found in internet. Probably they are outdated since Qt is evolving.

          Finally I decided to do it like in official instructions. First I tried to use windeployqt tool on executable created by QtCreator, but it didn't work.

          Then I used these commands on folder where PRO file exists:

          qmake -config release
          qmake project.pro
          mingw32-make
          windeployqt Project.exe
          

          And it works.

          But I have a question. There are folders like translations etc. I didn't configure something for translations but they are still there. I think they are useless. I opened program and tried to delete everything while running. Some of them are deleted, at the end size of folder became around 40 mb from 70 mbs.

          Does this cause problems later? Because I am not sure about how it works.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @maydin said in Cannot run program after deployment:

          Does this cause problems later? Because I am not sure about how it works.

          hard to say, without knowing what features you really use in your application.
          If you don't use translations, you dont need them of course

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          1

          • Login

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