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

Running .exe file in ubuntu

Scheduled Pinned Locked Moved Solved Installation and Deployment
13 Posts 4 Posters 27.3k 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.
  • V Vijaykarthikeyan

    @hskoglund I have the source code and if I want to compile it and build it in ubuntu terminal,does it work ?

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

    @Vijaykarthikeyan said in Running .exe file in ubuntu:

    in ubuntu terminal,does it work ?

    How should we know?
    It depends whether this application was written as a cross platform application or not. But you do not provide much details...

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

    V 1 Reply Last reply
    1
    • jsulmJ jsulm

      @Vijaykarthikeyan said in Running .exe file in ubuntu:

      in ubuntu terminal,does it work ?

      How should we know?
      It depends whether this application was written as a cross platform application or not. But you do not provide much details...

      V Offline
      V Offline
      Vijaykarthikeyan
      wrote on last edited by
      #5

      @jsulm I have written the file in Qt creator. Is there any tool in Qt to write in cross platforms?

      jsulmJ 1 Reply Last reply
      0
      • V Vijaykarthikeyan

        @jsulm I have written the file in Qt creator. Is there any tool in Qt to write in cross platforms?

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

        @Vijaykarthikeyan Why don't you simply try to build your application on Linux?
        Qt IS a cross platform framework, so if your app uses Qt and no Windows-only stuff then it should build on Linux just fine...

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

        V 1 Reply Last reply
        1
        • jsulmJ jsulm

          @Vijaykarthikeyan Why don't you simply try to build your application on Linux?
          Qt IS a cross platform framework, so if your app uses Qt and no Windows-only stuff then it should build on Linux just fine...

          V Offline
          V Offline
          Vijaykarthikeyan
          wrote on last edited by
          #7

          @jsulm No., the Theme is is not to install Qt every time in each and every end user. We don't know which machine are they running whether it is windows or ubuntu. We can't force them to install Qt . My theme is to give the end user a running block irrespective of the platforms

          JonBJ jsulmJ 2 Replies Last reply
          0
          • V Vijaykarthikeyan

            @jsulm No., the Theme is is not to install Qt every time in each and every end user. We don't know which machine are they running whether it is windows or ubuntu. We can't force them to install Qt . My theme is to give the end user a running block irrespective of the platforms

            JonBJ Online
            JonBJ Online
            JonB
            wrote on last edited by JonB
            #8

            @Vijaykarthikeyan
            Depends what you mean by "installing" Qt. End users do not have to install Qt (and still less Qt Creator). Your application should be packaged/deployed with the required dependent Qt libraries. End user just installs your package.

            We don't know which machine are they running whether it is windows or ubuntu.

            Then you won't know what package to give them, for Windows or Ubuntu.

            Executable files for one platform do not run on the other platform (Windows<->Linux). This has nothing to do with Qt.

            You have 3 choices:

            • You compile your app with Qt once under Windows and once separately under Ubuntu. Then you have a choice of executables to deliver to end user.
            • The end user uses something like Wine to get Windows executables run under Linux or WSL to get Linux executable to run under Windows.
            • You change your Qt application to be a WASM one, that is browser-based so should work under either OS.
            V 1 Reply Last reply
            0
            • JonBJ JonB

              @Vijaykarthikeyan
              Depends what you mean by "installing" Qt. End users do not have to install Qt (and still less Qt Creator). Your application should be packaged/deployed with the required dependent Qt libraries. End user just installs your package.

              We don't know which machine are they running whether it is windows or ubuntu.

              Then you won't know what package to give them, for Windows or Ubuntu.

              Executable files for one platform do not run on the other platform (Windows<->Linux). This has nothing to do with Qt.

              You have 3 choices:

              • You compile your app with Qt once under Windows and once separately under Ubuntu. Then you have a choice of executables to deliver to end user.
              • The end user uses something like Wine to get Windows executables run under Linux or WSL to get Linux executable to run under Windows.
              • You change your Qt application to be a WASM one, that is browser-based so should work under either OS.
              V Offline
              V Offline
              Vijaykarthikeyan
              wrote on last edited by
              #9

              @JonB So,You are concluding that single compile file would not support both the environments. We have to compile individually for the platforms. Isn't it?

              jsulmJ JonBJ 2 Replies Last reply
              0
              • V Vijaykarthikeyan

                @jsulm No., the Theme is is not to install Qt every time in each and every end user. We don't know which machine are they running whether it is windows or ubuntu. We can't force them to install Qt . My theme is to give the end user a running block irrespective of the platforms

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

                @Vijaykarthikeyan said in Running .exe file in ubuntu:

                the Theme is is not to install Qt every time in each and every end user

                Did I say you have to?!
                I said you can BUILD your application for Linux.
                After building you need to deploy it, so it contains all needed dependencies including Qt libraries and plug-ins. See https://doc.qt.io/qt-6/linux-deployment.html
                Keep in mind that there are many many different Linux distribution and if you build on one of them the binary will not necesserily run on all others.

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

                1 Reply Last reply
                0
                • V Vijaykarthikeyan

                  @JonB So,You are concluding that single compile file would not support both the environments. We have to compile individually for the platforms. Isn't it?

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

                  @Vijaykarthikeyan said in Running .exe file in ubuntu:

                  Isn't it?

                  In general yes. Windows != Linux.
                  You can try to run your Windows build on Linux using Wine, which was already suggested by @hskoglund in this thread...

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

                  V 1 Reply Last reply
                  1
                  • jsulmJ jsulm

                    @Vijaykarthikeyan said in Running .exe file in ubuntu:

                    Isn't it?

                    In general yes. Windows != Linux.
                    You can try to run your Windows build on Linux using Wine, which was already suggested by @hskoglund in this thread...

                    V Offline
                    V Offline
                    Vijaykarthikeyan
                    wrote on last edited by
                    #12

                    @jsulm ok..thank you for clarifying my doubt.

                    1 Reply Last reply
                    0
                    • V Vijaykarthikeyan has marked this topic as solved on
                    • V Vijaykarthikeyan

                      @JonB So,You are concluding that single compile file would not support both the environments. We have to compile individually for the platforms. Isn't it?

                      JonBJ Online
                      JonBJ Online
                      JonB
                      wrote on last edited by
                      #13

                      @Vijaykarthikeyan said in Running .exe file in ubuntu:

                      @JonB So,You are concluding that single compile file would not support both the environments. We have to compile individually for the platforms. Isn't it?

                      Absolutely. Qt (which is just a set of C++ libraries) has never said it would produce a single executable which would run cross-platform. That is not possible. What it promises/allows is source code which can be cross-platform. You still have to compile the common source code separately to target one platform versus another.

                      Unless you are going to pursue the second or third bullet point suggestions in my previous response you will want to do the first, which means separate compilation by you for each platform and you deliver just the appropriate one to each end user. And although cross compilation (you only develop on one of Windows or Linux and on that machine you do one native compilation to target the same OS and a different cross compilation to generate code for the other) may be possible it is simplest/you are likely to want the two platforms yourself and compile your application under each one separately.

                      1 Reply Last reply
                      2

                      • Login

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