How to build Qt 4.8.4 from source for 64bit or 32bit targets
-
I'm a little confused by how to build Qt from the source when the options for -embedded are arm, mips, x86 or generic. There is no option to specify 32bit or 64bit, from a quick search using Google it looks like the chosen compiler makes the decision, posts suggest using Qt Creator to build.
Is there a full guide someplace that details how to build for either 32bit and/or 64bit for x86 platforms?
-
@KroMignon , built thank you, when using:
sudo su gmake install
Where does this install the binaries too?
[Edit] Strange location but it seems to be installing everything in:
/usr/local/Trolltech/Qt-4.8.4
@SPlatten said in How to build Qt 4.8.4 from source for 64bit or 32bit targets:
Where does this install the binaries too?
you can specify many things with
configure
(cf. https://www.linuxfromscratch.org/blfs/view/7.9/x/qt4.html).
This should work for you:./configure -platform linux-g++-32 -prefix /opt/qt4.8
-
I'm a little confused by how to build Qt from the source when the options for -embedded are arm, mips, x86 or generic. There is no option to specify 32bit or 64bit, from a quick search using Google it looks like the chosen compiler makes the decision, posts suggest using Qt Creator to build.
Is there a full guide someplace that details how to build for either 32bit and/or 64bit for x86 platforms?
-
@SPlatten Are you targetting Windows?
Then take a look at this old post https://forum.qt.io/post/268631
@KroMignon , no the target is an older distribution of Linux called Finx. I'm told this is based on Gentoo and is an internally created Linux.
-
@SPlatten Are you targetting Windows?
Then take a look at this old post https://forum.qt.io/post/268631
@KroMignon , when building using:
./configure
I see the build uses g++ with -m64, is there a way to get it to build for a 32bit target?
-
@KroMignon , when building using:
./configure
I see the build uses g++ with -m64, is there a way to get it to build for a 32bit target?
-
@SPlatten according to post https://forum.qt.io/post/521682, this should do the job:
./configure -platform linux-g++-32
@KroMignon said in How to build Qt 4.8.4 from source for 64bit or 32bit targets:
./configure -platform linux-g++-32
Thank you, will give it a go.
-
Last year I had to cross-compile Qt 4 (in my case: Qt 4.4) for a number (4+) of different embedded targets. The compilers that were available to me for each platform each had their own quirks. Sometimes simply invoking the compiler from its full, absolute path was enough to make everything build and link, and other times it was necessary to explicitly manipulate some environment variables, to source some provided bash files, and to discern some specific compiler flags to add to the command line.
Two of the scripts that I ended up with are public on github.
To be clear, I am not suggesting that these will work verbatim for your case. Certainly they will not. But skimming them might give you inspiration or clues for any issues you run into with this Gentoo/Finx platform.
-
@SPlatten according to post https://forum.qt.io/post/521682, this should do the job:
./configure -platform linux-g++-32
@KroMignon , built thank you, when using:
sudo su gmake install
Where does this install the binaries too?
[Edit] Strange location but it seems to be installing everything in:
/usr/local/Trolltech/Qt-4.8.4
-
@KroMignon , built thank you, when using:
sudo su gmake install
Where does this install the binaries too?
[Edit] Strange location but it seems to be installing everything in:
/usr/local/Trolltech/Qt-4.8.4
@SPlatten said in How to build Qt 4.8.4 from source for 64bit or 32bit targets:
Where does this install the binaries too?
You can specify where to install when you call configure (don't remember exact parameter, -prefix probably).
-
@KroMignon , built thank you, when using:
sudo su gmake install
Where does this install the binaries too?
[Edit] Strange location but it seems to be installing everything in:
/usr/local/Trolltech/Qt-4.8.4
@SPlatten said in How to build Qt 4.8.4 from source for 64bit or 32bit targets:
Where does this install the binaries too?
you can specify many things with
configure
(cf. https://www.linuxfromscratch.org/blfs/view/7.9/x/qt4.html).
This should work for you:./configure -platform linux-g++-32 -prefix /opt/qt4.8
-
@SPlatten said in How to build Qt 4.8.4 from source for 64bit or 32bit targets:
Where does this install the binaries too?
you can specify many things with
configure
(cf. https://www.linuxfromscratch.org/blfs/view/7.9/x/qt4.html).
This should work for you:./configure -platform linux-g++-32 -prefix /opt/qt4.8
@KroMignon , thank you.
-
Another important step to include if like me you built 64 bit first then 32bit....remember to insert a call to:
make clean
Before the next configure or you will end up with architecture errors.