Score:4

How to run a QT5 program compiled for i386 on ubuntu 22.04.1

mx flag

I have an old program compiled for an ubuntu 16.04 i386, I need to run it or recompile for i386 architecture in my new pc (change 32 to 64 bit is quite complicated in this code". I have an ubuntu 22.04.1 but I dont know how to run 32 bit program on 64 bit ubuntu

pl flag
If you let us know what the program is (assuming it's open source or source available) someone may be able to provide you with a guide. Without knowing which program it is, the options may be many, or limited.
Juan Jose avatar
mx flag
@popey It is not an open source code, but the problem will be the same as if I did with a Hello World Window with some push buttons and tables...
David avatar
cn flag
So your real question is how can you run a 32 bit program on a 64 bit OS?
pl flag
No, it isn't the same. Dependencies, how it's built (cmake vs make or whatever) and so on makes it different. I might have recommended bundling in a snap or lxc or docker, depending on what it was.
Juan Jose avatar
mx flag
@popey it is a c++ Program and it uses a lot of qt libs and only libusb lib. It uses make for build
Juan Jose avatar
mx flag
@David yes it is. I do not need to compile it...
pl flag
What happens if you just run it? What does it complain about? 32-bit code can run on 64-bit installs. But some of the 32-bit libraries it may depend on have been removed, making this problem harder to solve.
Juan Jose avatar
mx flag
@popey `bash: ./motor No such file or directory` so I did `ls -la -rxwxr-xr-x 1 user user 7414460 Feb 14 15:15 motor`
pl flag
can you run `ldd ./motor` and see what libraries it's after?
Juan Jose avatar
mx flag
@popey `not a dynamic executable`
pl flag
Might need to use `strace` to see what it's after. If it's something you only need now and then, you could spin up a 32-bit 16.04 VM and run it there, but if you need it regularly, it's likely you're going to need to port to 64-bit or get someone else do to the port.
hr flag
`No such file or directory` and `not a dynamic executable` likely mean you don't even have a loader for 32-bit executables (ex. `/lib32/ld-linux.so.2`) on your system - at a minimum, you will need to add the i386 architecture and install the libc6:i386 package I think. Then you will be able to see what other 32-bit dynamic libs are missing.
Juan Jose avatar
mx flag
@steeldriver you where right I finally got it. Simply run the following commands: `sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libc6:i386 libstdc++6:i386` I also installed the following packages from apt `sudo apt-get install qtbase5-dev:i386 qtmultimedia5-dev:i386` Now everything is working perfectly.
us flag
@JuanJose can you answer your own question? That will help other users in the future
NotTheDr01ds avatar
vn flag
Does this answer your question? [Can't install i386 package(s)](https://askubuntu.com/questions/1350169/cant-install-i386-packages)
Juan Jose avatar
mx flag
@NoElDr01ds No, It doesnt
Score:2
mx flag

First

sudo dpkg --add-architecture i386 
sudo apt-get update
sudo apt-get install libc6:i386 libstdc++6:i386

This allow my system to recognize which libraries the program needs. Then, know libs needed.

ldd your_program_name

I needed a lot of Qt libs so I installed.

sudo apt-get install qtbase5-dev:i386 qtmultimedia5-dev:i386

That is all that I needed.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.