How to install the correct Qt5 version for the GCC compiler "arm-linux-generic-elf-64bit"

34 Views Asked by At

I'm trying to set up Qt5 on a Raspberry Pi 4 Model B, 8GB RAM. I can get it to work with a 32bit compiler, but can't figure out how to set it up so it works with a 64bit compiler. I would like to know how I can download and configure the correct Qt version to work with the arm-linux-generic-elf-64bit compiler.

I installed Qt with the following commands on my Raspberry Pi 4 Model B running the 64bit Bullseye OS:

sudo apt-get install qtbase5-dev qtchooser sudo apt-get install qt5-qmake qtbase5-dev-tools sudo apt-get install qtcreator sudo apt-get install qtdeclarative5-dev

After that I tried to configure a new kit with the 64bit compiler and got the following error:

"The compiler GCC (C++, arm 64bit i /usr/bin)" (arm-linux-generic-elf-64bit) cannot produce code for the QT version "Qt 5.15.2 in PATH (qt5)" (arm-linux-generic-elf-32bit)."

I expected apt to install a version of Qt that can compile 64bit code, since I am working with a 64bit operating system - obviously this is not the case.

UPDATE: As proposed in the commands, I tried to build QT from scratch on my device. I followed this tutorial with the platform-option "linux-rpi64-vc4-g++". After building and installing, I added the new Qt version under Tools->Options->Kits->Qt Versions. The details of this version are:

Name: Qt 5.15.12 (5.15)

ABI: arm-linux-generic-elf-32bit

Source: /opt/Qt/5.15

mkspec: linux-rpi64-vc4-g++

So even though the platform option and mkspec indicate 64bit versions, the ABI is still 32bit which means I get the same error as described above when I try to configure the kit.

0

There are 0 best solutions below