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 deploy an QT App from Windows to Linux?

How to deploy an QT App from Windows to Linux?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 4.8k 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.
  • P Offline
    P Offline
    pachisuro4096
    wrote on last edited by
    #1

    I am a Windows user.
    Made a Qt app by Qt Creator.
    windeployqt.exe works fine on windows.

    now I want to create a Linux version of my app.
    But I google the way to deploy on Linux.
    What I can find is the way of "write, compile, run app on Linux, use linuxdeployqt to deploy the app".
    I can't find the way of "made on Windos, and deploy app to Linux"

    I am totally rookie of Linux, is there has a way to make a linux version app made by windows environment?
    Or I have to make a Linux environment, copy source code to compile that?

    thank you for your reading.

    jsulmJ JonBJ 2 Replies Last reply
    0
    • P pachisuro4096

      I am a Windows user.
      Made a Qt app by Qt Creator.
      windeployqt.exe works fine on windows.

      now I want to create a Linux version of my app.
      But I google the way to deploy on Linux.
      What I can find is the way of "write, compile, run app on Linux, use linuxdeployqt to deploy the app".
      I can't find the way of "made on Windos, and deploy app to Linux"

      I am totally rookie of Linux, is there has a way to make a linux version app made by windows environment?
      Or I have to make a Linux environment, copy source code to compile that?

      thank you for your reading.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @pachisuro4096 The easiest way is to have a Linux machine to build your application for Linux. It can be a real machine or a virtual machine in your Windows.

      Another, more complicated to set up, way is to do cross compilation on Windows but for Linux. In this case you would need to set up a cross compilation environment first.

      I suggest to go with the first option. In stall Linux on a machine and build your app there.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • P pachisuro4096

        I am a Windows user.
        Made a Qt app by Qt Creator.
        windeployqt.exe works fine on windows.

        now I want to create a Linux version of my app.
        But I google the way to deploy on Linux.
        What I can find is the way of "write, compile, run app on Linux, use linuxdeployqt to deploy the app".
        I can't find the way of "made on Windos, and deploy app to Linux"

        I am totally rookie of Linux, is there has a way to make a linux version app made by windows environment?
        Or I have to make a Linux environment, copy source code to compile that?

        thank you for your reading.

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

        @pachisuro4096
        Hello and welcome.

        Executables built on one platform, Windows, cannot be run on another platform, Linux. Qt source code is (should be) compatible for different platform targets, but it has to be re-compiled for the target architecture, and only after that can be deployed there.

        I may be mistaken, but I do not think there is a viable cross-compiler available for Windows to produce Linux code.

        I would suggest the best way is to install a virtual machine (e.g. VirtualBox) on the Windows machine which runs a flavor of Linux. Then you copy your source project into that box and do the Linux compilation there.

        Finally, unlike Windows there are many different Linux distributions, with both different Linux flavors and different hardware architectures. A Qt/C++ application compiled for one flavor/architecture will not work on a different Linux flavor/architecture. So you have to know which Linuxes you want to target, and likely compile for each one (possibly cross-compilable from a gcc compiler on one architecture).

        1 Reply Last reply
        2
        • P Offline
          P Offline
          pachisuro4096
          wrote on last edited by
          #4

          I got it!! Thanks both of you !!
          Now I'm going to study how to build a Linux and QT.

          JonBJ 1 Reply Last reply
          0
          • P pachisuro4096

            I got it!! Thanks both of you !!
            Now I'm going to study how to build a Linux and QT.

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

            @pachisuro4096
            For example, I fetched VirtualBox (you can Google, it's easy to find) and put on my Windows (7) host. Then I downloaded the latest Ubuntu "image" from the web, and followed instructions to install that into the VB as guest OS. Now you have a running Linux any time you want as a virtual machine on your Windows box. You can boot into it, run Linux, do your development there (in a window, you can still use Windows for everything else). It's quite fun :)

            There are other choices than these, but this is (an example of) what having a Linux VM on a Windows box is like.

            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