官方教程:
https://wiki.qt.io/RaspberryPi2EGLFS
中文提示:
http://blog.csdn.net/a_power/article/details/52809728
需要用到的工具列表:
tools工具:
https://github.com/raspberrypi/tools
qt-everywhere-opensource-src-5.6.1.tar.gz:
http://download.qt.io/official_releases/qt/5.7/5.7.1/single/
qt5.7.1 的桌面安装包:
https://www.qt.io/download-open-source/#section-2
sysroot-relativelinks.py(不需要预先下载在编译中添加即可):
https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
2016-09-23-raspbian-jessie.img(raspberry 系统):
https://www.raspberrypi.org/downloads/raspbian/
基本流程参考官网流程和中文参考网站,我个人编译成功,环境是16.04 -64bit Qt5.7.1(其它版本也没事情) 树莓派3B+ 2016-09-23-raspbian-jessie.img
提示参考官方教程或者中文教程前,请先看我的几个提示点
我只针对几个大家可能不清楚的点做一下补充说明:
几个注意点
1、 树莓派账号:pi 密码:raspberry
进入界面方式 sudo raspi-config
1)先把系统存储拓展到整张SD卡
2)为了和电脑连接(使用ssh):使能SSH 路径:Advanced Options--->SSH
3)切换GUI界面:路径:Boot Options--->Console Autologin(选择这个是避免登入输密码)
4)修改GPU内存:路径:Advanced Options---> A3 Memory Split --->修改内存值256
5)退出重启之后,临时设置树莓派IP地址:sudo ifconfig eth0 192.168.1.2
设置电脑端的IP地址:sudo ifconfig eth0 192.168.1.1
相互之间ping Ip地址,通了再进行下一步
2、
将原本禁用的 deb-src 恢复使用,Ctrl+o 保存,Ctrl+x退出
接下去按程序流程进行
3、
raspberrypi : 树莓派IP地址
rsync -avz pi@192.168.1.2:/lib sysroot
4、
64位系统需要改成-x64
5、调整屏幕设置,建议参考官方教程(最后Additional notes)
6、缺少某个库,比如我在编译中出现提示缺少数据库,则如下方式添加
举例
1、添加qtserialport库,首先进入qtserialport目录下,~/raspi/qt-everywhere-opensource-src-5.7.1-qtserialport
2、运行
~/raspi/qt5/bin/qmake -r
3、make
4、make install
5、cd ~/raspi(返回到raspi文件下)
6、rsync -avz qt5pi pi@IP:/usr/local
7、编译,使用
进入工程目录下:
1、cd workspace/qt/SmartCabinet
2、~/raspi/qt5/bin/qmake
3、make
4、传入树莓派