# 1.修改Debian10 buster版的镜像源,路径在/etc/apt/source.list中
# 镜像(Debian or ubuntu)
# 出现错误签证使用:
# sudo apt-key adv --recv-keys --keyserver keyserver.Ubuntu.com 40976EAF437D05B5(错误代码)
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
# 2.依赖包安装 sudo aptitude install
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
# 确认是否全部安装完毕
sudo apt install cmake build-essential libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev libjasper-dev
# 3.解压opencv源码包,在解压后的文件夹内创建build文件夹,并进入该构建目录内
mkdir build
cd build
# 4.cmake编译
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/testopencv ..
#
make -j$(nproc)
# install
make install
# 5.修改配置文件,路径在/etc/ld.so.conf.d内,创建一个OpenCV.conf,填入下面内容
include /opt/testopencv/lib
#保存并生效
sudo ldconfig
# 6.在/home/linaro下的.bashrc文件内加入下面内容
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/testopencv/lib/pkgconfig
export PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/testopencv/lib
export PATH=$PATH:/opt/testopencv/bin
# 配置生效
source ~/.bashrc
# 输入判断配置是否生效
pkg-config --modversion opencv
# 7.在rk3568上安装默认的QT5
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install g++
sudo apt-get install gcc
sudo apt-get install qt5-default //基本库
sudo apt-get install gdb // 安装调试器
sudo apt-get install qtcreator //IDE(如果只是运行程序,则无需安装)
# 查询版本
qmake -version
# 最后在左下角“编程”找到qtcreator
# 重要
https://blog.csdn.net/qq_43445867/article/details/126624382
# 参考
https://blog.csdn.net/anmo_moan/article/details/126960730