这篇文章参考了https://blog.csdn.net/Cappuccino_jay/article/details/125220734
无论是在wsl2、物理机还是虚拟机上,安装过程都基本一致。
$ sudo apt-get update #更新软件源
$ sudo apt-get install build-essential #安装编译所需的库
$ sudo apt-get install cmake pkg-config git #安装一些必要的工具
$ sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev python-dev-is-python3 python3-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libtiff5-dev libswscale-dev libjasper-dev libdc1394-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
code snippet