sudo nano etcssh/ssh_config sudo nano /etc/ssh/sshd_config
sudo passwd root sudo reboot
nano etcapt/sources.list
apt-get dist-upgrade
reboot
rpi-update
reboot
sudo apt-get build-dep qt5-qmake sudo apt-get build-dep libqt5webengine-data sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0
mkdir /usr/local/qt5pi chown -R root:root /usr/local/qt5pi
apt-get update
apt-get -y upgrade
apt-get install gcc git bison python gperf pkg-config
sudo mkdir opt/qt5pi sudo chown 1000:1000 opt/qt5pi cd opt/qt5pi git clone https://github.com/raspberrypi/tools
export PATH=$PATH:/opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
. ~/.bashrc
from this http://download.qt.io/official_releases/qt/ you need to select your version we are going to use qt5.12 you need qt-everywhere path that zip file for qt file which will we use for cross compile it will support qt required documents for compile
wget download.qt.io/official_releases/qt/5.12/5.12.5/single/qt-everywhere-src-5.12.5.tar.xz tar xf qt-everywhere-5.12.5.tar.xz ## if you download another version use your ##downloaded file name it will recompress your tar file
cp -R qt-everywhere-src-5.12.5/qtbase/mkspecs/linux-arm-gnueabi-g++ qt-everywhere-src-5.12.5/qtbase/mkspecs/linux-arm-gnueabihf-g++
with sed you can add or edit your text file in this line adding new config line in your qmake.conf file
sed -i -e 's/arm-linux-gnueabi-/arm-linux-gnueabihf-/g' qt-everywhere-src-5.12.5/qtbase/mkspecs/linux-arm-gnueabihf-g++/qmake.conf
create new directory for rsync with your raspberry it will help to get important file from your remote !
rsync -avz root@your_raspberry_pi_ip_address:/lib sysroot
rsync -avz root@your_raspberry_pi_ip_address:/usr/include sysroot/usr
rsync -avz root@your_raspberry_pi_ip_address:/usr/lib sysroot/usr
rsync -avz root@your_raspberry_pi_ip_address:/opt/vc sysroot/opt
mv sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0_backup
ln -s sysroot/opt/vc/lib/libEGL.so sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0
mv sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0_backup
ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
ln -s sysroot/opt/vc/lib/libEGL.so sysroot/opt/vc/lib/libEGL.so.1
ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/opt/vc/lib/libGLESv2.so.2
wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
chmod +x sysroot-relativelinks.py ./sysroot-relativelinks.py sysroot
rsync -avz root@your_raspberry_pi_ip_address:/lib sysroot
rsync -avz root@your_raspberry_pi_ip_address:/usr/include sysroot/usr
rsync -avz root@your_raspberry_pi_ip_address:/usr/lib sysroot/usr
rsync -avz root@your_raspberry_pi_ip_address:/opt/vc sysroot/opt
./sysroot-relativelinks.py sysroot
mkdir qt5build cd qt5build
lets call configure file with your qt-everywhere file name if you ae using any other rasp you need to change to infront of -device to with below comments :
##raspbery pi 0 = linux-rasp-pi-g++
## raspberry pi 2 = linux-rasp-pi2-g++
## raspberry pi 3 = linux-rasp-pi3-g++
## vor pi3 + vc4 direver = linux-rasp-pi3-vc4-g++
../qt-everywhere-src-5.10.1/configure -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtscript -nomake examples -make libs -pkg-config -no-use-gold-linker -v
make -j8
make install
cd /opt/qt5pi
rsync -avz sysroot/usr/local/qt5pi [email protected]:/usr/local
/opt/qt5pi/sysroot/usr/local/qt5pi/bin/qmake
make
scp filename root@your_raspberry_pi_ip_address : ##here directroy if you give like that it will copy to home
Follow Below to add your Cross compile file To QT that means when you press debug, your project will work on the raspberry pi !
then enter kits>debuggers add path : /opt/qt5pi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gdb
path: /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++
path: /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc
sysRoot : /opt/qt5pi/sysroot