在Windows上编译QGC 4.3.0

软件版本:

QGC4.3.0(master 最新)
QT6.6.1
VSvs2019

1. 下载和安装 QT

  1. 官网安装包下载地址 qt-unified-windows-x64-4.6.1-online.exeicon-default.png?t=N7T8https://download.qt.io/official_releases/online_installers/
  2. 命令行中运行:
    .\qt-unified-windows-x64-4.6.1-online.exe --mirror https://mirrors.tuna.tsinghua.edu.cn/qt
  3. 如果出错可以试试腾讯的镜像 `--mirror https://mirrors.cloud.tencent.com/qt`

  4. 登录QT账户、同意协议、选择安装文件夹、选择需要安装的 6.6.1 版本(MSVC 2019 是必须的)组件,如果没有想要安装的版本,勾选 Archive,再筛选,一步一步安装。如果在安装过程中出现下载失败,可以重新打开安装器,寻找下图图标(前几步左下角),清理缓存 再下载安装。

2. 下载和安装 VS2019

  1.  Visual Studio 2019安装包网盘链接:https://pan.baidu.com/s/13H6TfDU-uyLxJssERvXgTw? pwd=1234icon-default.png?t=N7T8https://pan.baidu.com/s/13H6TfDU-uyLxJssERvXgTw?%20%20pwd=1234
  2.  选择要安装的组件,只需 使用C++的桌面开发 即可,选择安装的目录,继续安装。

3. 编译QGC

  1. 克隆代码:
    git clone git@github.com:mavlink/qgroundcontrol.git
    git submodule init
    git submodule update
  2. 使用 Qt Creator 打开项目,在 项目 中打开 Manage KitsKits 配置 Qt Versions Kits,如下图所示:





  3. 编译项目。

4. 编译遇到的问题

1. error: Project ERROR: Unknown module(s) in QT: core5compat

缺少 core5compat ,core5compat 模块:为了帮助开发者从Qt 5迁移到Qt 6,Qt 6提供了一个名为 core5compat 的兼容性模块。这个模块包含了一些在Qt 6中被弃用但在Qt 5中常用的类和方法。重新运行 Qt Maintenance Tool,在版本 6.6.1 中寻找名为“Qt 5 Compatibility Module”或类似名称的组件,添加 core5compat 模块。https://blog.csdn.net/weixin_73178823/article/details/135956188icon-default.png?t=N7T8https://blog.csdn.net/weixin_73178823/article/details/135956188

2. error: C1083: 无法打开包括文件: “nlohmann_json/single_include/nlohmann/json_fwd.hpp”: No such file or directory

缺少 nlohmann_json,添加 nlohmann,并更新。

cd libs/libevents/libevents/libs/cpp/parse/nlohmann_json
git remote add nlohmann https://github.com/nlohmann/json
git fetch nlohmann
# 返回qgc目录下
cd -
git submodule update --init --recursive

https://github.com/mavlink/qgroundcontrol/issues/10825#issuecomment-1776732665icon-default.png?t=N7T8https://github.com/mavlink/qgroundcontrol/issues/10825#issuecomment-1776732665

  • 25
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值