安装sudo apt-get install libsdl2-dev
安装qt 5.12.05
下载地址是:http://iso.mirrors.ustc.edu.cn/qtproject/archive/qt/5.12/5.12.5/qt-opensource-linux-x64-5.12.5.run
执行安装;
下载 qgroundcontrol 源代码
需要 echo " export Qt5_DIR=/opt/Qt5.12.5/5.12.5/gcc_64/lib/cmake/Qt5" >> ~/.bashrc
source ~/.bashrc
否则编译会报错;
git clone https://github.com/mavlink/qgroundcontrol.git
cd qgroundcontrol/
git submodule update --init --recursive
下载完成后,在 qgroundcontrol 源代码目录下执行:
cmake .
make -j4
如果上述编译报错,可以用下面的方法:
mkdir build
cd build/
qmake ../qgroundcontrol.pro
(qmake 是在 /opt/Qt5.12.5/5.12.5/gcc_64/bin/ 下面)
make -j16
编译完成,生成的可执行文件在这里:
qgroundcontrol/build/staging$ ls
QGroundControl qgroundcontrol.desktop qgroundcontrol.png qgroundcontrol-start.sh Qt