搭建QT开发环境

树莓派硬件

  • Raspberry Pi 4 Model B

安装系统

下载镜像

Raspberry Pi OS with desktop (64-bit)
  • https://downloads.raspberrypi.com/raspios_arm64/images/raspios_arm64-2023-10-10/2023-10-10-raspios-bookworm-arm64.img.xz

Ubuntu 22.04.3 LTS Desktop
  • https://cdimage.ubuntu.com/releases/22.04.3/release/ubuntu-22.04.3-preinstalled-desktop-arm64+raspi.img.xz

烧写镜像

下载
烧写TF卡

查看系统信息

查看体系结构
# arch
查看系统版本
Raspberry Pi OS with desktop (64-bit)
# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Ubuntu 22.04.3 LTS Desktop

修改软件源

Raspberry Pi OS with desktop (64-bit)

编辑/etc/apt/sources.list文件.

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
Ubuntu 22.04.3 LTS Desktop

安装QT开发环境

# apt update
# apt install qtbase5-dev
# apt-get install qtbase5-dev-tools
# apt-get install qt5-qmake
# apt-get install qtcreator
# apt install clang
烧写镜像
查看系统信息
# arch
修改软件源

编辑/etc/apt/sources.list文件.

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
安装QT开发环境
# apt update
# apt install qtbase5-dev
# apt-get install qtbase5-dev-tools
# apt-get install qt5-qmake
# apt-get install qtcreator
# apt install clang

创建QT应用

创建工程

编译运行