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 build a 32bit application on 64bit Qt Creator
QtWS25 Last Chance

How to build a 32bit application on 64bit Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 4 Posters 8.6k 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.
  • R Offline
    R Offline
    Renn
    wrote on last edited by
    #1

    Hello friends, I want to ask something about qmake compiler. I want to build an application that is based 32bit, qt creator I install the 64bit, how do we compile our project at IDE 64bit?

    1 Reply Last reply
    0
    • sneubertS Offline
      sneubertS Offline
      sneubert
      wrote on last edited by
      #2

      You need a 32bit Kit in Qt Creator consisting of compiler, debugger and Qt (qmake and libraries). BTW qmake is for generating the projects compile instructions. Ist not a compiler.

      R 1 Reply Last reply
      0
      • sneubertS sneubert

        You need a 32bit Kit in Qt Creator consisting of compiler, debugger and Qt (qmake and libraries). BTW qmake is for generating the projects compile instructions. Ist not a compiler.

        R Offline
        R Offline
        Renn
        wrote on last edited by
        #3

        @sneubert Oh so, compiler kit 32bit already exists, the problem is that when I build the debian package to directly generate the 64bit compiler.

        1 Reply Last reply
        0
        • sneubertS Offline
          sneubertS Offline
          sneubert
          wrote on last edited by
          #4

          could you post some error information

          R 1 Reply Last reply
          0
          • sneubertS sneubert

            could you post some error information

            R Offline
            R Offline
            Renn
            wrote on last edited by
            #5

            @sneubert /usr/bin/untitled: Cannot execute binary file.
            I think it's because the compiler error when I build a debian package was put on 64bit, 64bit I've tried it on and it works.

            1 Reply Last reply
            0
            • sneubertS Offline
              sneubertS Offline
              sneubert
              wrote on last edited by
              #6

              Ok, now I´m confused.
              Could you clarify the exact problem? You are on a 64bit Linux with Qt Creator 64bit installed and a valid 32bit Kit and want to create a 32bit executable. The error you posted raises after building with the 32bit Kit, if you try to run the executable? Or is the error from the build process itself?

              R 1 Reply Last reply
              0
              • sneubertS sneubert

                Ok, now I´m confused.
                Could you clarify the exact problem? You are on a 64bit Linux with Qt Creator 64bit installed and a valid 32bit Kit and want to create a 32bit executable. The error you posted raises after building with the 32bit Kit, if you try to run the executable? Or is the error from the build process itself?

                R Offline
                R Offline
                Renn
                wrote on last edited by
                #7

                @sneubert The issue here, when I build a debian package it in a 64bit operating system, Qt Creator that I installed also 64bit. When debian package is finished, I am trying to install on a 64bit operating system is working, when I install on a 32bit operating system, the installation is successful, when I run the application display a notification so at the command line, because I try to run it at the command line.

                jsulmJ 1 Reply Last reply
                0
                • R Renn

                  @sneubert The issue here, when I build a debian package it in a 64bit operating system, Qt Creator that I installed also 64bit. When debian package is finished, I am trying to install on a 64bit operating system is working, when I install on a 32bit operating system, the installation is successful, when I run the application display a notification so at the command line, because I try to run it at the command line.

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

                  @Renn Then you use the wrong (64bit) kit to build your app. Make sure you use the right kit.

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

                  1 Reply Last reply
                  0
                  • sneubertS Offline
                    sneubertS Offline
                    sneubert
                    wrote on last edited by
                    #9

                    Like jsulm suggested make sure you create a 32bit executable. You can check the executable with readelf.
                    Could you post the Output of
                    readelf -h /usr/bin/untitled

                    R 1 Reply Last reply
                    0
                    • sneubertS sneubert

                      Like jsulm suggested make sure you create a 32bit executable. You can check the executable with readelf.
                      Could you post the Output of
                      readelf -h /usr/bin/untitled

                      R Offline
                      R Offline
                      Renn
                      wrote on last edited by
                      #10

                      @sneubert So what is to be prepared? I do not know what to be prepared to cross compile from 64bit to 32bit.

                      jsulmJ JohanSoloJ 2 Replies Last reply
                      0
                      • R Renn

                        @sneubert So what is to be prepared? I do not know what to be prepared to cross compile from 64bit to 32bit.

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

                        @Renn Didn't you say before you already have a 32bit kit? That's what you need.

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

                        R 1 Reply Last reply
                        0
                        • R Renn

                          @sneubert So what is to be prepared? I do not know what to be prepared to cross compile from 64bit to 32bit.

                          JohanSoloJ Offline
                          JohanSoloJ Offline
                          JohanSolo
                          wrote on last edited by
                          #12

                          @Renn said:

                          So what is to be prepared? I do not know what to be prepared to cross compile from 64bit to 32bit.

                          You need to install the corresponding compiler. On a 64 bits system when you install a compiler, the default is to install only the 64 bits one. But you've already said that you have a 32 bits kit on your computer...

                          In order to be sure, I'd compile a simple hello world program from the command line once calling the 64 bits compiler and once calling the 32 bits compiler. I'd run both of them to check that they are both executing fine. Then I'd check the binaries with the readelf utility @sneubert told you about. Forcing the compilation in 32/64 bits is done by adding the -m32 / -m64 to the gcc / clang command line.

                          `They did not know it was impossible, so they did it.'
                          -- Mark Twain

                          R 1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @Renn Didn't you say before you already have a 32bit kit? That's what you need.

                            R Offline
                            R Offline
                            Renn
                            wrote on last edited by
                            #13

                            @jsulm Already there are 32 bits of Qt Creator, I do not know anything about it, whether existing 32bit kit or not, when I said yes already there, it is only in qt creator ............. ..... the rest I do not know whether it is or or not.

                            jsulmJ 1 Reply Last reply
                            0
                            • R Renn

                              @jsulm Already there are 32 bits of Qt Creator, I do not know anything about it, whether existing 32bit kit or not, when I said yes already there, it is only in qt creator ............. ..... the rest I do not know whether it is or or not.

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

                              @Renn It is not about QtCreator. If you want to create 32bit binaries you need a compiler generating 32bit binaries. On Ubuntu the package containing g++ compiler for x86 is called g++:i386, don't know what is the name on Debian.

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

                              1 Reply Last reply
                              0
                              • JohanSoloJ JohanSolo

                                @Renn said:

                                So what is to be prepared? I do not know what to be prepared to cross compile from 64bit to 32bit.

                                You need to install the corresponding compiler. On a 64 bits system when you install a compiler, the default is to install only the 64 bits one. But you've already said that you have a 32 bits kit on your computer...

                                In order to be sure, I'd compile a simple hello world program from the command line once calling the 64 bits compiler and once calling the 32 bits compiler. I'd run both of them to check that they are both executing fine. Then I'd check the binaries with the readelf utility @sneubert told you about. Forcing the compilation in 32/64 bits is done by adding the -m32 / -m64 to the gcc / clang command line.

                                R Offline
                                R Offline
                                Renn
                                wrote on last edited by
                                #15

                                @JohanSolo Yes it is working, but if I make a debian package, it turns into a 64bit only. I've tried to use gcc gcc -m32 and -m64 it can, but when I build a debian package, it only 64bit only .............................

                                1 Reply Last reply
                                0
                                • JohanSoloJ Offline
                                  JohanSoloJ Offline
                                  JohanSolo
                                  wrote on last edited by
                                  #16

                                  Well, in this case ask on your distro forum how to build a 32 bits package from a 64 bits platform...
                                  Or simply create a source package (i.e. automatically compiled when installing).

                                  `They did not know it was impossible, so they did it.'
                                  -- Mark Twain

                                  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