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. .exe in Build file not working
Forum Updated to NodeBB v4.3 + New Features

.exe in Build file not working

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 322 Views 3 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.
  • serkan_trS Offline
    serkan_trS Offline
    serkan_tr
    wrote on last edited by
    #1

    When I build it with Qt Creator and run it on Qt Creator, the program works without any problems, but when I go to the folder and run it, it does not work because the .dll files are missing. After running windeployqt this time it says different .dll is missing.

    What is the reason for this?

    b1d43b9a-6ddd-4b62-90dd-7f7a99482c49-image.png

    artwawA 1 Reply Last reply
    0
    • R Offline
      R Offline
      Redman
      wrote on last edited by Redman
      #3

      Step 1.)
      If you are using CMake you can do following:
      This configures the install command to create a deploy folder in your binary dir in which the deployed application will be placed.

      # Deploy path
      set(CMAKE_INSTALL_BINDIR ${CMAKE_BINARY_DIR}/deploy)
      set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_BINDIR})
      
      install(TARGETS ${name}
          RUNTIME DESTINATION  ${CMAKE_INSTALL_BINDIR}
      )
      

      Step 2.) (either this qml approach or the widget approach)
      if you have an qml app:
      This adds all the needed qml dependencies needed for your application to run.

      	qt_generate_deploy_qml_app_script(
      		TARGET ${name}
      		OUTPUT_SCRIPT deploy_script
      	)
      	install(SCRIPT ${deploy_script})
      

      Step 2.) (either this widget approach or the qml approach)
      if you have a widget app
      This adds all the needed widget dependencies needed for your application to run.

      	qt_generate_deploy_app_script(
      		TARGET ${PROJECT_NAME}
      		OUTPUT_SCRIPT deploy_script
      	)
      	install(SCRIPT ${deploy_script})
      

      Step 3.)
      Finally, after doing all this you have to tell QtCreator to call the install toolchain to actually install your application.

      Go to QtCreator -> Project -> Build -> Build Steps.

      If you want to let CMake do the installation you can add a cmake build step:
      be086b67-7dde-44b0-b2e8-1e0503085eed-image.png

      If you use ninja like me you can then add a custom process step:
      650f34af-a62c-4ec4-81a1-2aa821470d30-image.png

      1 Reply Last reply
      2
      • serkan_trS serkan_tr

        When I build it with Qt Creator and run it on Qt Creator, the program works without any problems, but when I go to the folder and run it, it does not work because the .dll files are missing. After running windeployqt this time it says different .dll is missing.

        What is the reason for this?

        b1d43b9a-6ddd-4b62-90dd-7f7a99482c49-image.png

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #2

        @serkan_tr please familiarise yourself with this documentation: https://doc.qt.io/qt-6/windows-deployment.html

        You are missing deployments steps, your program is missing libraries.

        For more information please re-read.

        Kind Regards,
        Artur

        1 Reply Last reply
        3
        • R Offline
          R Offline
          Redman
          wrote on last edited by Redman
          #3

          Step 1.)
          If you are using CMake you can do following:
          This configures the install command to create a deploy folder in your binary dir in which the deployed application will be placed.

          # Deploy path
          set(CMAKE_INSTALL_BINDIR ${CMAKE_BINARY_DIR}/deploy)
          set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_BINDIR})
          
          install(TARGETS ${name}
              RUNTIME DESTINATION  ${CMAKE_INSTALL_BINDIR}
          )
          

          Step 2.) (either this qml approach or the widget approach)
          if you have an qml app:
          This adds all the needed qml dependencies needed for your application to run.

          	qt_generate_deploy_qml_app_script(
          		TARGET ${name}
          		OUTPUT_SCRIPT deploy_script
          	)
          	install(SCRIPT ${deploy_script})
          

          Step 2.) (either this widget approach or the qml approach)
          if you have a widget app
          This adds all the needed widget dependencies needed for your application to run.

          	qt_generate_deploy_app_script(
          		TARGET ${PROJECT_NAME}
          		OUTPUT_SCRIPT deploy_script
          	)
          	install(SCRIPT ${deploy_script})
          

          Step 3.)
          Finally, after doing all this you have to tell QtCreator to call the install toolchain to actually install your application.

          Go to QtCreator -> Project -> Build -> Build Steps.

          If you want to let CMake do the installation you can add a cmake build step:
          be086b67-7dde-44b0-b2e8-1e0503085eed-image.png

          If you use ninja like me you can then add a custom process step:
          650f34af-a62c-4ec4-81a1-2aa821470d30-image.png

          1 Reply Last reply
          2
          • serkan_trS serkan_tr has marked this topic as solved on

          • Login

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