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 make .exe file on Ubuntu
QtWS25 Last Chance

How to make .exe file on Ubuntu

Scheduled Pinned Locked Moved General and Desktop
17 Posts 6 Posters 19.9k 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.
  • L Offline
    L Offline
    Legnain
    wrote on 18 Sept 2013, 08:29 last edited by
    #1

    Hello every one.

    I wrote a code using Qt Creator 2.5.2 ( Based on Qt 4.8.1 64 bit) , which installed on Ubuntu 12.04 (precise) 64-bit. I genenrated a excutable file, which work only on Ubuntu. and when I tried to generate .exe file using the following command:
    $i586-mingw32msvc-g++ -o calculator.exe main.cpp mainwindow.cpp
    I got this error:
    main.cpp:1:30: error: QtGui/QApplication: No such file or directory
    So, how can I generate .exe file to to work on windows OS.

    My best regards

    Legnain

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xcoder
      wrote on 18 Sept 2013, 10:02 last edited by
      #2

      Hola,

      To cross-compile Qt application, it's not as easy as using just g++ (you can though). But normally you use qmake to compile your Qt app.

      The easiest approach would be just to compile your Qt app on windows. But it's not bad to know and learn how to do cross-compilation either. Check "this blog":http://divided-mind.blogspot.co.uk/2007/09/cross-compiling-qt4win-on-linux.html, for instructions how to do it. I found that link "here, in Qt documentation":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html.

      Only a biker knows why a dog sticks his head out of a car window.

      1 Reply Last reply
      1
      • L Offline
        L Offline
        Legnain
        wrote on 18 Sept 2013, 15:41 last edited by
        #3

        I will check this.

        many thanks.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Legnain
          wrote on 20 Sept 2013, 05:45 last edited by
          #4

          Finaly, I found the solution in the following link
          http://stackoverflow.com/questions/10934683/how-do-i-configure-qt-for-cross-compilation-from-linux-to-windows-target

          Here is the steps

          #1 Get it:
          $ git clone https://github.com/mxe/mxe.git

          #2 Build Qt for Windows, its dependencies, and the cross-build tools; this will take about an hour on a fast machine with decent internet access; the download is about 500MB:
          $ cd mxe && make qt

          #3 Get to the directory of your app and add the cross-build tools to the PATH:
          $ export PATH=<mxe root>/usr/bin:$PATH

          #4 Run the Qt Makefile generator tool then build:
          $ <mxe root>/usr/i686-pc-mingw32/qt/bin/qmake && make

          #5 You should find the binary in the ./release directory:
          $ wine release/foo.exe

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rahul Samanta
            wrote on 17 Nov 2018, 12:53 last edited by
            #5
            Please provide me a complete solution to make .exe  of QT Application in Ubuntu 18.0
            
            M 1 Reply Last reply 17 Nov 2018, 13:04
            0
            • D Offline
              D Offline
              dheerendra
              Qt Champions 2022
              wrote on 17 Nov 2018, 13:02 last edited by
              #6

              You can't make .exe on ubuntu platform. exe extension is only for windows.

              Have you installed Qt on Ubuntu ?
              Are you able to launch Qt creator ?

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              1 Reply Last reply
              1
              • R Rahul Samanta
                17 Nov 2018, 12:53
                Please provide me a complete solution to make .exe  of QT Application in Ubuntu 18.0
                
                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 17 Nov 2018, 13:04 last edited by
                #7

                @Rahul-Samanta
                Hi
                you have to come up with better description about what you are doing or
                nobody can really help you,
                If you are not cross compiling, an exe is made pr default.
                so can you add some details about platforms, what type of exe
                and so on you are trying to make ?

                1 Reply Last reply
                2
                • R Offline
                  R Offline
                  Rahul Samanta
                  wrote on 17 Nov 2018, 13:05 last edited by
                  #8

                  Yes sir, I'm able to launch the Qt Creator, in Ubuntu. and developed some demo Qt GUI Application, those are running fine in build mode.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    dheerendra
                    Qt Champions 2022
                    wrote on 17 Nov 2018, 13:11 last edited by
                    #9

                    that is good. You are able to build & run the program. It means the executable is built and it works. Now tell us what are you searching for ?

                    Dheerendra
                    @Community Service
                    Certified Qt Specialist
                    http://www.pthinks.com

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Rahul Samanta
                      wrote on 17 Nov 2018, 13:48 last edited by
                      #10

                      Sir, I want a single setup file of that existing QT project in Ubuntu/ Linux, that will run in other Linux machine. now I am running the application in Build mode from Qt Creator.

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        dheerendra
                        Qt Champions 2022
                        wrote on 17 Nov 2018, 16:18 last edited by
                        #11

                        ok. For this you need all the dependent libraries to copied. You can some thing like deployment tools. It should help you to package all the dependent so files

                        Dheerendra
                        @Community Service
                        Certified Qt Specialist
                        http://www.pthinks.com

                        1 Reply Last reply
                        1
                        • R Offline
                          R Offline
                          Rahul Samanta
                          wrote on 18 Nov 2018, 11:51 last edited by
                          #12

                          Sir, I tried this approach but, I am not getting the procedure rather the steps to follow. sir, can you please specify the steps to follow in detail.
                          Thanks & Regards,
                          Rahul.

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            dheerendra
                            Qt Champions 2022
                            wrote on 18 Nov 2018, 12:37 last edited by
                            #13

                            For any application to run you need to have all dependent libraries. So for qt you need to copy all the dependent libraries like libqtwidgets,libcore, lingui.so etc library files. Please copy all these libraries to new system along with your executable. If you run linuxdeploymet tool it will automatically to copy them. Hope it is clear

                            Dheerendra
                            @Community Service
                            Certified Qt Specialist
                            http://www.pthinks.com

                            1 Reply Last reply
                            1
                            • R Offline
                              R Offline
                              Rahul Samanta
                              wrote on 19 Nov 2018, 10:25 last edited by
                              #14

                              Hi, Sir, inside that deployment tools [linuxdeployqt (https://github.com/probonopd/linuxdeployqt), I can't find out the "linuxdeployqt.appimage "file. Without this file how is it possible to run rather install the Liinuxdeployqt tools??
                              Thanks & Regards,
                              Rahul.

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                dheerendra
                                Qt Champions 2022
                                wrote on 25 Nov 2018, 06:47 last edited by
                                #15

                                @Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.

                                Dheerendra
                                @Community Service
                                Certified Qt Specialist
                                http://www.pthinks.com

                                R 1 Reply Last reply 26 Nov 2018, 06:15
                                0
                                • D dheerendra
                                  25 Nov 2018, 06:47

                                  @Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.

                                  R Offline
                                  R Offline
                                  Rahul Samanta
                                  wrote on 26 Nov 2018, 06:15 last edited by
                                  #16

                                  @dheerendra said in How to make .exe file on Ubuntu:

                                  @Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.

                                  Hi Sir, I have fixed all those deployment issues using the linuxdeplyqt and linuxdeployqt.appimage, able to create executable for QT application. also tested the application for other Linux pc, and its working fine.
                                  Thanks & Regards,
                                  Rahul.

                                  T 1 Reply Last reply 15 Jun 2023, 09:21
                                  1
                                  • R Rahul Samanta
                                    26 Nov 2018, 06:15

                                    @dheerendra said in How to make .exe file on Ubuntu:

                                    @Rahul-Samanta In general you need dependent library for the program to work. Copy all the Qt*.so files along with executable. It should work.

                                    Hi Sir, I have fixed all those deployment issues using the linuxdeplyqt and linuxdeployqt.appimage, able to create executable for QT application. also tested the application for other Linux pc, and its working fine.
                                    Thanks & Regards,
                                    Rahul.

                                    T Offline
                                    T Offline
                                    the woft
                                    wrote on 15 Jun 2023, 09:21 last edited by the woft
                                    #17

                                    @Rahul-Samanta hi sir , you can guide for me using linuxdeplyqt and linuxdeployqt.appimage

                                    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