How to build a 32bit application on 64bit Qt Creator
-
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.
-
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? -
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?@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.
-
@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.
-
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
-
@sneubert So what is to be prepared? I do not know what to be prepared to cross compile from 64bit to 32bit.
-
@sneubert So what is to be prepared? I do not know what to be prepared to cross compile from 64bit to 32bit.
@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. -
@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.
@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.
-
@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.@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 .............................