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. Create Linux Executable for Qt Application
Forum Updated to NodeBB v4.3 + New Features

Create Linux Executable for Qt Application

Scheduled Pinned Locked Moved Solved Installation and Deployment
23 Posts 4 Posters 8.8k 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.
  • J jsulm
    9 Jul 2020, 04:39

    @jineshmehta If your app is starting from QtCreator then it is an executable.
    Can you please post the output from "file YOUR_APP_EXE"? It will tell you what it really is.
    It could be that the file manager shows the wrong type for whatever reason.

    The reason why it does not start from explorer is most probably because you did not deploy it properly. See https://doc.qt.io/qt-5/linux-deployment.html
    QtCreator prepares the environment before it starts the app, so all Qt libs/plug-ins can be found. But when you start manually from file manager or terminal you have to prepare the environment or create a package (deploy the app).

    J Offline
    J Offline
    jineshmehta
    wrote on 9 Jul 2020, 12:46 last edited by
    #7

    @jsulm This is the output from the cmd you asked:

    EMAT: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=585d3259887dc7b35fc4cb07d6e0f1f57a77168f, with debug_info, not stripped

    1 Reply Last reply
    0
    • J jsulm
      9 Jul 2020, 04:39

      @jineshmehta If your app is starting from QtCreator then it is an executable.
      Can you please post the output from "file YOUR_APP_EXE"? It will tell you what it really is.
      It could be that the file manager shows the wrong type for whatever reason.

      The reason why it does not start from explorer is most probably because you did not deploy it properly. See https://doc.qt.io/qt-5/linux-deployment.html
      QtCreator prepares the environment before it starts the app, so all Qt libs/plug-ins can be found. But when you start manually from file manager or terminal you have to prepare the environment or create a package (deploy the app).

      J Offline
      J Offline
      jineshmehta
      wrote on 9 Jul 2020, 12:47 last edited by
      #8

      @jsulm Let me know if the app is deployed properly or not. If not, can you please pin point a location where I can start to look?

      J 1 Reply Last reply 9 Jul 2020, 12:51
      0
      • J jineshmehta
        9 Jul 2020, 12:47

        @jsulm Let me know if the app is deployed properly or not. If not, can you please pin point a location where I can start to look?

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 9 Jul 2020, 12:51 last edited by
        #9

        @jineshmehta said in Create Linux Executable for Qt Application:

        can you please pin point a location where I can start to look?

        The link I posted before.
        The file output looks fine, so please take a look at the link and deploy your app before starting it.

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

        1 Reply Last reply
        0
        • J jsulm
          8 Jul 2020, 11:50

          @jineshmehta Can you post your pro file?
          Does your app run?
          What does "file YOUR_APP_EXE" say?

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 9 Jul 2020, 12:51 last edited by
          #10

          @jineshmehta

          Can you post your pro file?

          Could you answer @jsulm request please?

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jineshmehta
            wrote on 9 Jul 2020, 13:57 last edited by
            #11

            Hi,

            I am using pluginandpaint examples from qt for now.

            @jsulm I am trying the shared libaray approach for creating my executable. Following is the snap of everything i have :
            a2e0ff0a-1dad-44cc-bb65-5093aa5bde6f-image.png

            I tried following instructions provided as follows:

            cdc14674-fd81-43ac-8cf9-0c776b018ad9-image.png

            And I should get a executable but no luck. :(

            J 1 Reply Last reply 10 Jul 2020, 04:19
            0
            • J jineshmehta
              9 Jul 2020, 13:57

              Hi,

              I am using pluginandpaint examples from qt for now.

              @jsulm I am trying the shared libaray approach for creating my executable. Following is the snap of everything i have :
              a2e0ff0a-1dad-44cc-bb65-5093aa5bde6f-image.png

              I tried following instructions provided as follows:

              cdc14674-fd81-43ac-8cf9-0c776b018ad9-image.png

              And I should get a executable but no luck. :(

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 10 Jul 2020, 04:19 last edited by
              #12

              @jineshmehta Can you please post the whole pro file as text?
              "And I should get a executable but no luck. :(" - I'm sure you get an executable (or is compiling failing? If so please post the errors), as it is working from QtCreator. You're hunting the wrong issue. And you did NOT follow all instructions. You stop after building, but you have to deploy. Please take a look and follow the chapter "Creating the Application Package" in the link I posted.

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

              J 1 Reply Last reply 10 Jul 2020, 05:43
              0
              • J jsulm
                10 Jul 2020, 04:19

                @jineshmehta Can you please post the whole pro file as text?
                "And I should get a executable but no luck. :(" - I'm sure you get an executable (or is compiling failing? If so please post the errors), as it is working from QtCreator. You're hunting the wrong issue. And you did NOT follow all instructions. You stop after building, but you have to deploy. Please take a look and follow the chapter "Creating the Application Package" in the link I posted.

                J Offline
                J Offline
                jineshmehta
                wrote on 10 Jul 2020, 05:43 last edited by
                #13

                @jsulm I have created a small video of the step I am following. Let me know if something is wrong.
                FYI :
                https://streamable.com/ockbjf

                J 1 Reply Last reply 10 Jul 2020, 07:04
                0
                • J jineshmehta
                  10 Jul 2020, 05:43

                  @jsulm I have created a small video of the step I am following. Let me know if something is wrong.
                  FYI :
                  https://streamable.com/ockbjf

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 10 Jul 2020, 07:04 last edited by
                  #14

                  @jineshmehta Please open a terminal go to the directory where your app was deployed to and start the app. Do you see any errors/warnings?

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

                  J 1 Reply Last reply 10 Jul 2020, 07:58
                  0
                  • J jsulm
                    10 Jul 2020, 07:04

                    @jineshmehta Please open a terminal go to the directory where your app was deployed to and start the app. Do you see any errors/warnings?

                    J Offline
                    J Offline
                    jineshmehta
                    wrote on 10 Jul 2020, 07:58 last edited by
                    #15

                    @jsulm ce44198b-3a92-4b4b-8136-d5c1458bdf55-image.png

                    J 1 Reply Last reply 10 Jul 2020, 08:01
                    0
                    • J jineshmehta
                      10 Jul 2020, 07:58

                      @jsulm ce44198b-3a92-4b4b-8136-d5c1458bdf55-image.png

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 10 Jul 2020, 08:01 last edited by
                      #16

                      @jineshmehta UNIX basics: ./plugandpaint

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

                      J 1 Reply Last reply 10 Jul 2020, 08:04
                      1
                      • J jsulm
                        10 Jul 2020, 08:01

                        @jineshmehta UNIX basics: ./plugandpaint

                        J Offline
                        J Offline
                        jineshmehta
                        wrote on 10 Jul 2020, 08:04 last edited by
                        #17

                        @jsulm It works. But cant we create an executable?

                        J 1 Reply Last reply 10 Jul 2020, 08:09
                        0
                        • J jineshmehta
                          10 Jul 2020, 08:04

                          @jsulm It works. But cant we create an executable?

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 10 Jul 2020, 08:09 last edited by jsulm 7 Oct 2020, 08:09
                          #18

                          @jineshmehta said in Create Linux Executable for Qt Application:

                          It works. But cant we create an executable?

                          I don't get it: if it works it is already an executable.
                          Or do you mean you want to have everything in one single executable?

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

                          J 1 Reply Last reply 10 Jul 2020, 08:16
                          1
                          • J jsulm
                            10 Jul 2020, 08:09

                            @jineshmehta said in Create Linux Executable for Qt Application:

                            It works. But cant we create an executable?

                            I don't get it: if it works it is already an executable.
                            Or do you mean you want to have everything in one single executable?

                            J Offline
                            J Offline
                            jineshmehta
                            wrote on 10 Jul 2020, 08:16 last edited by
                            #19

                            @jsulm i want it like send one. Something like qtmaintainence tool

                            @jineshmehta said in Create Linux Executable for Qt Application:

                            I am trying to create a executable file on Linux something like maintenance tool (see snap)

                            1de6f95e-5ec6-468d-8a22-e19e67941570-image.png

                            I am using Template as app for my qt project like this :

                            #config
                            CONFIG += c++11
                            #template
                            TEMPLATE = app

                            The file getting created is a shared library. I don't know why. Please assist.

                            bba1db06-fd1c-4131-9b41-d4083cf1ac2b-image.png

                            J 2 Replies Last reply 10 Jul 2020, 08:22
                            0
                            • J jineshmehta
                              10 Jul 2020, 08:16

                              @jsulm i want it like send one. Something like qtmaintainence tool

                              @jineshmehta said in Create Linux Executable for Qt Application:

                              I am trying to create a executable file on Linux something like maintenance tool (see snap)

                              1de6f95e-5ec6-468d-8a22-e19e67941570-image.png

                              I am using Template as app for my qt project like this :

                              #config
                              CONFIG += c++11
                              #template
                              TEMPLATE = app

                              The file getting created is a shared library. I don't know why. Please assist.

                              bba1db06-fd1c-4131-9b41-d4083cf1ac2b-image.png

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 10 Jul 2020, 08:22 last edited by
                              #20

                              @jineshmehta Sorry, I don't understand what you mean. plugandpaint is your executable, so what do you want to change?

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

                              1 Reply Last reply
                              0
                              • J jineshmehta
                                10 Jul 2020, 08:16

                                @jsulm i want it like send one. Something like qtmaintainence tool

                                @jineshmehta said in Create Linux Executable for Qt Application:

                                I am trying to create a executable file on Linux something like maintenance tool (see snap)

                                1de6f95e-5ec6-468d-8a22-e19e67941570-image.png

                                I am using Template as app for my qt project like this :

                                #config
                                CONFIG += c++11
                                #template
                                TEMPLATE = app

                                The file getting created is a shared library. I don't know why. Please assist.

                                bba1db06-fd1c-4131-9b41-d4083cf1ac2b-image.png

                                J Offline
                                J Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on 10 Jul 2020, 08:26 last edited by
                                #21

                                @jineshmehta If you're confused by this "shared library" in file manager shown for plugandpaint then this is an issue in the file manager. My file manager also shows "shared library" for executables for whatever reason.

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

                                J 1 Reply Last reply 10 Jul 2020, 08:29
                                0
                                • J jsulm
                                  10 Jul 2020, 08:26

                                  @jineshmehta If you're confused by this "shared library" in file manager shown for plugandpaint then this is an issue in the file manager. My file manager also shows "shared library" for executables for whatever reason.

                                  J Offline
                                  J Offline
                                  jineshmehta
                                  wrote on 10 Jul 2020, 08:29 last edited by
                                  #22

                                  @jsulm oh ok. I was confused about that only. Thanks for the clarification.

                                  1 Reply Last reply
                                  0
                                  • J Offline
                                    J Offline
                                    jineshmehta
                                    wrote on 11 Jul 2020, 07:32 last edited by
                                    #23

                                    @jsulm I found the problem and the solution as well. Check this out: https://stackoverflow.com/questions/45329372/ubuntu-recognizes-executable-as-shared-library-and-wont-run-it-by-clicking

                                    1 Reply Last reply
                                    0

                                    16/23

                                    10 Jul 2020, 08:01

                                    • Login

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