Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build 32-bit Qt5 application on 64-bit Ubuntu

I have currently got the 64-bit version of Qt5 installed on a 64-bit Ubuntu machine but I'd also like to be able to do 32-bit builds on the same machine. On Windows I can simply select additional kits in the MaintenanceTool but on Linux this doesn't seem to be possible. Or am I missing something?

like image 550
Alan Spark Avatar asked Oct 25 '17 16:10

Alan Spark


People also ask

How do I install 32-bit software on 64 bit Ubuntu?

To install 32-bit libraries on Ubuntu 12.04 LTS (64-bit), open Terminal and type sudo apt-get install ia32-libs (you will need to enter your password). Then just for good measure, let's make sure your Ubuntu is up to date. Type sudo apt-get update and lastly, restart your computer.

Can Ubuntu run 32-bit apps?

To be able to run a 32-bit program on 64-bit Linux system such as Ubuntu, you need to add i386 architecture and install 3 library packages libc6:i386, libncurses5:i386, and libstdc++6:i386.

How do I change the QT version in Ubuntu?

Select Tools > Options > Build & Run > Qt Versions > Add. Select the qmake executable for the Qt version that you want to add. Select the Qt version to view and edit it. In the Version name field, edit the name that Qt Creator suggests for the Qt version. In the qmake location field, you can change the qmake location.

How do I run qt5 on Ubuntu?

Launch Qt Creator. Go to Tools > Options. Click Build & Run and select tab Kit. Configure a compiler if it is not automatically detected.

How to run 32-bit app on 64-bit Linux?

Here are the steps to run 32-bit app on 64-bit Linux. To be able to run a 32-bit program on 64-bit Linux system such as Ubuntu, you need to add i386 architecture and install 3 library packages libc6:i386, libncurses5:i386, and libstdc++6:i386. 1. Add 1386 Architecture

Should I compile 32 bit or 64 bit version?

First thing, it doesn't matter whether you want to compile 32 or 64 bit version. The only difference is the command prompt shortcut that you have to choose from Visual Studio, which will initialize different environment variables.

How do I add qmake to qtbase?

Click on "Add" and select qmake from the folder where your bin in qtbase is, so from above: (or for Linux choose the path where you installed the compiled Qt source, which is equivalent to /home/username/Qt5.7-install/qtbase/bin/qmake in this tutorial)

How do I add a kit to a Qt Project?

(or for Linux choose the path where you installed the compiled Qt source, which is equivalent to /home/username/Qt5.7-install/qtbase/bin/qmake in this tutorial) Click OK. Now just open a project and you'll find it asking you to choose the kit you added.


1 Answers

Three steps:

  1. Get the 32 bit version from Qt or build from source with ./configure -platform linux-g++-32.
  2. Make sure it gets installed to a different path than the 64-bit version. Can be achieved with something like ./configure -platform linux-g++-32 -prefix /opt/qt32 or the path that feels comfortable to you.
  3. Fix compiler settings along these lines for building the application
like image 100
ferrix Avatar answered Oct 21 '22 03:10

ferrix