前言:
现在QGC最新的版本为v4.1.1,但是网上的教程主要都是针对于3.x的版本,但是许多3.x版本中的文件在4.x中已经不存在了,所以为了方便学习开发,选择安装QGC3.4稳定版。
https://github.com/mavlink/qgroundcontrol/tree/Stable_V3.4
一、软件
软件 | 版本 |
---|---|
Qt | 5.11.0 |
Visual Studio | 2015 |
Git |
Qt、VS的软件版本必须选择指定版本,否则会出现未知错误。
1.1 安装Qt
Qt安装教程:【Qt】安装最新方案
1.2 安装VS2015
vs2015下载
安装教程:http://c.biancheng.net/view/453.html
二、源码下载
-
纯英文路径下,新建文件夹,命名为:
qgroundcontrol-3.4
。 -
在该路径下打开Git。
-
Git内输入命令:
git clone --recursive https://github.com/mavlink/qgroundcontrol.git -b Stable_V3.4
并回车,即可开始下载。 -
下载完成后,进入到qgroundcontrol目录下:
cd qgroundcontrol
-
升级submodules:
git submodule update
三、运行项目
- 打开Qt Creater
- 菜单栏——文件——打开文件或项目——打开项目所在目录——选择qgroundcontrol.pro
- 选择Kit:Qt5.11.0 MSVC2015 32Bit,点击Run。
- 运行成果
四、常见报错
报错:
Unsupported Windows toolchain, only Visual Studio 2015 is supported
报错:
NMAKE👎 error: U1077: “rc”: 返回代码“0x1”
其他可参考教程:
https://www.it610.com/article/1295263820935143424.htm
https://www.bilibili.com/video/BV1t7411W7mA?p=3