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. How to share qt app with others?
Forum Updated to NodeBB v4.3 + New Features

How to share qt app with others?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 911 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.
  • H Offline
    H Offline
    HFT_developer
    wrote on last edited by
    #1

    Hi,

    I built a GUI app using Qt on my pc(Ubuntu Linux). Now I want to share my app with other people who do not have(or want) to install Qt. If I share the executable will it work on all Linux pc?

    Other than that how can I share my Qt app so it runs on Windows/macOS as well?

    JonBJ 1 Reply Last reply
    0
    • H HFT_developer

      Hi,

      I built a GUI app using Qt on my pc(Ubuntu Linux). Now I want to share my app with other people who do not have(or want) to install Qt. If I share the executable will it work on all Linux pc?

      Other than that how can I share my Qt app so it runs on Windows/macOS as well?

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

      @HFT_developer said in How to share qt app with others?:

      If I share the executable will it work on all Linux pc?

      No, because the executable requires lots of libraries (Qt, plus potentially others) and these will not be present on other systems.

      Qt app so it runs on Windows/macOS as well?

      You cannot give people a Linux-compiled executable and have it work on other platform! :) You have to obtain those machines and re-compile there to produce a native executable, or maybe cross-compile for those platform from your Linux. But I think the common consensus is that this does not work/is difficult for Windows at minimum, and you really need a Windows machine/VM to compile.

      When it comes to distributing your executable to others, you have to have something to deploy all the necessary files in the right places on the target. Start by reading https://doc.qt.io/qt-6/deployment.html. You will end using using tools like linuxdeployqt/windeployqt to achieve the distribution.

      One thing worth mentioning: if you do not want to have recompile your Qt code for each different platform, you might consider using Python/PySide for your application instead of C++. Python code works cross-platform (with Python/PySide installed on each target), there is no recompilation involved. You still need to deploy the application, but it's a lot easier than obtaining machines to produce native executables on. Food for thought.

      H 1 Reply Last reply
      0
      • JonBJ JonB

        @HFT_developer said in How to share qt app with others?:

        If I share the executable will it work on all Linux pc?

        No, because the executable requires lots of libraries (Qt, plus potentially others) and these will not be present on other systems.

        Qt app so it runs on Windows/macOS as well?

        You cannot give people a Linux-compiled executable and have it work on other platform! :) You have to obtain those machines and re-compile there to produce a native executable, or maybe cross-compile for those platform from your Linux. But I think the common consensus is that this does not work/is difficult for Windows at minimum, and you really need a Windows machine/VM to compile.

        When it comes to distributing your executable to others, you have to have something to deploy all the necessary files in the right places on the target. Start by reading https://doc.qt.io/qt-6/deployment.html. You will end using using tools like linuxdeployqt/windeployqt to achieve the distribution.

        One thing worth mentioning: if you do not want to have recompile your Qt code for each different platform, you might consider using Python/PySide for your application instead of C++. Python code works cross-platform (with Python/PySide installed on each target), there is no recompilation involved. You still need to deploy the application, but it's a lot easier than obtaining machines to produce native executables on. Food for thought.

        H Offline
        H Offline
        HFT_developer
        wrote on last edited by
        #3

        @JonB

        Is it not possible to compile for windows using a different kit(in your linux setup)? I do dual boot my pc so it has windows 11 + Ubuntu Linux. I mean for embedded processors you can create and upload binary so the same can't be done for windows?

        (Also I couldn't use Python in this case because I was building an app based on an algorithm written in C++)

        JonBJ 1 Reply Last reply
        0
        • H HFT_developer

          @JonB

          Is it not possible to compile for windows using a different kit(in your linux setup)? I do dual boot my pc so it has windows 11 + Ubuntu Linux. I mean for embedded processors you can create and upload binary so the same can't be done for windows?

          (Also I couldn't use Python in this case because I was building an app based on an algorithm written in C++)

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

          @HFT_developer
          And do you have a kit which runs under Linux and cross-compiles for Windows? Do your own investigation, my impression from other posts is that you end up needing to compile under Windows natively, they aren't available/don't work/aren't good enough.

          You should be able to translate (more or less) any algorithm from C++ to Python, they are both procedural languages. Fine if you don't want to use Python/PySide, then you will need to deal with producing native binaries for each target platform.

          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