Best Ubuntu setup for 32-bit * and * 64-bit Qt application development?

I am developing a qt-based application, and I would like to develop both the 32 and 64-bit versions of the application on the same machine, using the same sources, scripts, etc. The machine is a 64-bit Ubuntu Jaunty, Intel Core i7 processor, 8 GB. I know that when starting VMWare or VirtualBox you can make everything work, but this does not seem to be a good solution, since I want to use the processor (i7) to the full. I read about the chrooted environment, and it seems to me that this may be the setting I was looking for: I need a development machine to be able to run the newly created executable files.

Do you have any experience? Have you installed such a 32-bit chrooted env on a 64-bit host? Does this work well? How to configure it?

+6
64bit qt 32-bit chroot
source share
2 answers

I was in a similar but not exact situation. I developed Qt4 applications for 32-bit Windows, running on 64-bit Jaunty. The chroot'd environment will give you what you want, with a little annoyance about having to cut it in order to compile your 32-bit application.

What I did to compile for Windows is to configure the cross-compiler specifically for this purpose. You probably won't have to do this. You will probably be able to compile g ++ -m32 up to 32 bits. To avoid having to edit makefiles millions of times, you can create / modify / use the specfiles that come with Qt so you can do "qmake-project && qmake -makefile spec blablabla" (if I remember, the command syntax is correct).

+5
source share

I am also in a similar situation, and here is how I work:

I am using a custom version of Qt. I build Qt twice, with the same settings, with the exception of the -platform option, which I set for linux-g ++ - 64 for the first build and linux-g ++ - 32 for the second build. I also use the other -prefix to install both versions in separate directories.

I use QtCreator to build my applications. I added both versions of Qt in the Options → Qt4 → Qt dialog box. Then I set up two different build configurations for my projects with the same build parameters, but with one using a 32-bit Qt dir and one using a 64-bit Qt file. QtCreator then takes care of all the magic, and I just need to alternate between build configurations in order to have both a 32-bit and a 64-bit Qt application. No chroot, no VM, nothing, just a simple build.

However, there is one caveat. To build Qt for 32-bit, obviously, 32-bit versions of most development libraries (X libs, stdlibs, etc.) are required, which are easily accessible on Ubuntu Jaunty with ia32-libs and lib32stdC ++ 6. The only libraries that I could not find for 32-bit development in the architecture with a 64-bit interface, are gstreamer libs, which means that Phonon may not work. I needed Phonon, so I worked on the fact that by building Qt in a virtual machine, then copy the directory installed by Qt to my dev machine.

Good luck.

+3
source share

All Articles