之前配置好的环境给玩坏了,正好整理下opencv和qt的安装方式。
1.首先换成国内源,我用的是清华的源
sudo nano /etc/apt/sources.list
把原来的注释掉换成
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib
ctrl+o 保存 enter确认 ctrl+x退出
然后update一下
sudo apt-get update
2.安装opencv各种依赖项
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev
sudo apt-get install libtiff5-dev
sudo apt-get install libjasper-dev
sudo apt-get install libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt