Executable library permission?
-
BASE_DIR=$(dirname "$(readlink -f "$0")") export LD_LIBRARY_PATH="$BASE_DIR"/lib/:"$BASE_DIR":$LD_LIBRARY_PATH export QML_IMPORT_PATH="$BASE_DIR"/qml/:$QML_IMPORT_PATH export QML2_IMPORT_PATH="$BASE_DIR"/qml/:$QML2_IMPORT_PATH export QT_PLUGIN_PATH="$BASE_DIR"/plugins/:$QT_PLUGIN_PATH export QTWEBENGINEPROCESS_PATH="$BASE_DIR"/bin//QtWebEngineProcess export QTDIR="$BASE_DIR" export CQT_PKG_ROOT="$BASE_DIR" export CQT_RUN_FILE="$BASE_DIR/PCR_.sh" export QT_QPA_PLATFORM_PLUGIN_PATH="$BASE_DIR"/plugins//platforms:$QT_QPA_PLATFORM_PLUGIN_PATH "$BASE_DIR/bin/PCR_" "$@"

I developed and built qt in Ubuntu and completed the distribution file. After copying this distribution file to USB, I installed Raspberry Pi Ubuntu OS on the Raspberry Pi board, and the USB executable file was pasted into Raspberry Pi Ubuntu. I did not have permission to sh, so I gave permission, and when I run the following, PCR_.sh: 34 /home/ubuntu/Desktop/PCR_E/bin/PCR_: Permission denied
"$BASE_DIR/bin/PCR_" "$@"The contents of line 34 are the path is correct and I need to give it permission, but it's a library file, so I don't know how to give permission.
-
The file "PCR_" is not a library file, it is your program executable. It should have at least the u=rx attributes (but typically ugo=rx). You set the permissions the same way as you did for the shell script.
-
@ChrisW67
If you give the executable file permission, an Exec format error occurs as an error message.@IknowQT
If that is really true, then either you are not setting execute permission on an executable file but rather something else, or you have compiled the executable for a different architecture. Also you cannot execute a library.You might want run
file /path/to/the/executableon the target system to see what it says.I developed and built qt in Ubuntu and completed the distribution file. After copying this distribution file to USB, I installed Raspberry Pi Ubuntu OS on the Raspberry Pi board, and the USB executable file was pasted into Raspberry Pi Ubuntu.
I don't know what "Raspberry Pi Ubuntu OS" is. But there is no guarantee that something compiled under Ubuntu will run on another Ubuntu machine if the architectures are different.
-
@IknowQT
If that is really true, then either you are not setting execute permission on an executable file but rather something else, or you have compiled the executable for a different architecture. Also you cannot execute a library.You might want run
file /path/to/the/executableon the target system to see what it says.I developed and built qt in Ubuntu and completed the distribution file. After copying this distribution file to USB, I installed Raspberry Pi Ubuntu OS on the Raspberry Pi board, and the USB executable file was pasted into Raspberry Pi Ubuntu.
I don't know what "Raspberry Pi Ubuntu OS" is. But there is no guarantee that something compiled under Ubuntu will run on another Ubuntu machine if the architectures are different.
-
I think the architecture is different.
ubuntu architecture is amd64 and ubuntu uploaded to raspberry pi is arm64
Can you build from amd64 to arm64? not compatible?
Or do I have to make a cross-compile?@IknowQT said in Executable library permission?:
ubuntu architecture is amd64 and ubuntu uploaded to raspberry pi is arm64
That would indeed explain "Exec format error"! :)
Then you do indeed need to cross-compile on the original Ubuntu for the target ARM architecture. -
@IknowQT said in Executable library permission?:
ubuntu architecture is amd64 and ubuntu uploaded to raspberry pi is arm64
That would indeed explain "Exec format error"! :)
Then you do indeed need to cross-compile on the original Ubuntu for the target ARM architecture. -
Thanks for the reply, I'll talk about it here!
How do I cross-compile? Is it possible in qt creator?@IknowQT
I don't know because I have never done it, but, yes, it is certainly possible in Qt Creator. Until somebody answers specifically here, you might start by Googlingqt gcc cross compile arm, or more specificallycross compile qt for raspberry piseems to lead to various hits. -
Wow we're thread-jumping a lot in here :D
Here's something to start with: https://wiki.qt.io/RaspberryPi2EGLFS in your case, large parts of this guide will be different (it's a different OS, different toolchain (take Linaro instead of Raspberry Pi OS toolchain which is super outdated) etc.), libs might be different) but with some tweaking it should work.
-
Wow we're thread-jumping a lot in here :D
Here's something to start with: https://wiki.qt.io/RaspberryPi2EGLFS in your case, large parts of this guide will be different (it's a different OS, different toolchain (take Linaro instead of Raspberry Pi OS toolchain which is super outdated) etc.), libs might be different) but with some tweaking it should work.
-
I'm not using Raspbian OS, I just installed Ubuntu on a Raspberry board. I have two Ubuntus, they are different architectures.
Can you tell me how to cross-compile in this case?@IknowQT said in Executable library permission?:
I'm not using Raspbian OS, I just installed Ubuntu on a Raspberry board. I have two Ubuntus, they are different architectures.
I know, that's why I said those instructions won't work exactly as provided.
Can you tell me how to cross-compile in this case?
No, sorry, it's too much effort. I would have to do it all myself, too, to verify the information, and I don't have time for it now.
A high level summary is:
- update your RPi Ubuntu with dev packages (
sudo apt build-dep qt5-default) - get a toolchain from Linaro, for ARMHF or ARM64 architecture (depending on what your Ubuntu on RPi is using)
- get a sysroot (
rsyncthe whole OS from your Raspberry to your desktop) - get Qt (single tarball from archives, for example https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz)
- extract Qt
- run
configurewith correct flags (take ones from the EGLFS guide, but it probably won't work out of the box. Lots of trial and error and frustration will surely follow!) - run
make -j numberOfCpuCores - run
make install rsyncyour Qt installation back to RPi (you need to copy contents of folder you specified as-extprefixto folder on RPi you specified in-prefix)
Now you will have a working, cross-compiled Qt. You can add it to Qt Creator:
- add compiler (Linaro)
- add Qt version (your qmake is in folder you specified as
-hostprefix) - add kit
With that, you will have a working cross-compilation environment on your desktop Ubuntu. Each compiled binary you will have to send to RPi to run (this can be automated in Qt Creator, too).
Good luck!
- update your RPi Ubuntu with dev packages (