# How to compile QGC-herelink

**URL:** <https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913>\
**Category:** HereLink\
**Created:** [27 July 2021 11:18 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913 "2021-07-27T11:18:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![AltitudeDavid](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@AltitudeDavid](https://discuss.cubepilot.org/u/AltitudeDavid)\
**Post date:** [27 July 2021 11:18 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/1 "2021-07-27T11:18:46Z")

</div>

Is there a guide available on how to set up the build environment and compile CubePilot/qgroundcontrol-herelink?

The Readme on Github only generally lists 3 components, that you need, but not how to install and set up everything. I installed QtCreator and Qt5.11.0, but had no idea which modules to select while installing and some are probably missing, whioch is why I probably get a lot of errors. Also what do I do with the Android NDK folder, that I downloaded? Can anyone help me out, which modules to select exactly and generally how to set up the build environment?

Just as an example for Arducopter there are detailed instructions [on how to compile/build it](https://ardupilot.org/dev/docs/building-the-code.html). I am looking for something similar.

---

<div class="post-metadata">

**Author:** ![Alvin](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/alvin/32/1000_2.png) [@Alvin](https://discuss.cubepilot.org/u/Alvin)\
**Post date:** [30 July 2021 03:17 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/2 "2021-07-30T03:17:53Z")

</div>

It should be same as ordinary QGC  
[https://dev.qgroundcontrol.com/master/en/getting\_started/index.html](https://dev.qgroundcontrol.com/master/en/getting_started/index.html)

---

<div class="post-metadata">

**Author:** ![AltitudeDavid](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@AltitudeDavid](https://discuss.cubepilot.org/u/AltitudeDavid)\
**Post date:** [2 August 2021 11:47 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/3 "2021-08-02T11:47:37Z")

</div>

I can build regular QGC, but not the herelink version. I tried it on windows and ubuntu, but get the following error (on windows it´s the same):

```
:-1: error: Project ERROR: Cannot run target compiler '/home/david/Android/Sdk/ndk/21.3.6528147/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++'. Output:
===================
/bin/sh: 1: /home/david/Android/Sdk/ndk/21.3.6528147/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++: not found
===================
Maybe you forgot to setup the environment?

```

I don´t know why the error is about the default ndk even though I set up NKD15 as described in the readme.md. Here is my kit:

 ![AndroidKit](https://discuss.cubepilot.org/uploads/default/original/2X/a/ab294eebc6765a45761a02df24e6f4c7b11bc299.png)

edit. Btw. the [Qt website mentions](https://doc.qt.io/qt-5/android-getting-started.html), that we should use NDK r10e with Qt5.11 and earlier. I´m a bit confused.

---

<div class="post-metadata">

**Author:** ![AltitudeDavid](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@AltitudeDavid](https://discuss.cubepilot.org/u/AltitudeDavid)\
**Post date:** [3 August 2021 11:23 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/4 "2021-08-03T11:23:36Z")

</div>

Finally I did manage to build the code. I had to set the ANDROID\_NDK\_ROOT build environemnt variable to the NDK 15 location on my disk. And even so there was a problem, where QtCreator expected a folder to be named windows, but it was windows-x86\_64.

Now I just have to figure out QML programming and how to actually test it (how do I put it onto my Herelink???). This is the worst documented “open source” project I had to work on. Also why are there so few commits on GitHub? Where is the beta development going on? Or has QGC-herelink been converted to closed source?

---

<div class="post-metadata">

**Author:** ![Alvin](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/alvin/32/1000_2.png) [@Alvin](https://discuss.cubepilot.org/u/Alvin)\
**Post date:** [4 August 2021 02:05 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/5 "2021-08-04T02:05:48Z")

</div>

You should generate an apk file and install it to Herelink as mentioned in docs.cubepilot  
[https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/installing-a-custom-app](https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/installing-a-custom-app)

Note that you have to disable the stock QGC in Herelink so that 2 QGC won’t conflict.

The beta changes are not public. We release them when they become stable.

---

<div class="post-metadata">

**Author:** ![AltitudeDavid](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@AltitudeDavid](https://discuss.cubepilot.org/u/AltitudeDavid)\
**Post date:** [4 August 2021 08:12 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/6 "2021-08-04T08:12:23Z")

</div>

That didnt work, because you cant uninstall the default QGC. I managed to write a script, that flashes an img via fastboot according to this page: [OEM Image Setup - CubePilot](https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/oem-image-setup)

What I am trying to do is to control a Flir Duo Pro R from on screen buttons/switches, because all my hardware switches are already in use. I have successfully created a UI with an extra page in the flight map widgets in a qml file and the next step is to actually make the buttons do something. I need to send a few mavlink commands (basically move some servos with MAV\_CMD\_DO\_SET\_SERVO) and I am not sure how to do this yet. I probably need to create some c++ functions, that send the mavlink commands. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Alvin](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/alvin/32/1000_2.png) [@Alvin](https://discuss.cubepilot.org/u/Alvin)\
**Post date:** [5 August 2021 01:46 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/7 "2021-08-05T01:46:35Z")

</div>

> [@AltitudeDavid](#):
>
> That didnt work, because you cant uninstall the default QGC

You can’t uninstall the default QGC. You have to disable it

For buttons, try mavlink buttons:

> **[Configure Modes & Mavlink Buttons](https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/mavlink_buttons#to-configure-in-qgc)**

---

<div class="post-metadata">

**Author:** ![AltitudeDavid](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@AltitudeDavid](https://discuss.cubepilot.org/u/AltitudeDavid)\
**Post date:** [5 August 2021 05:54 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/8 "2021-08-05T05:54:37Z")

</div>

I don´t have anymore hardware buttons available (used them all for other functions) and that´s why I need on-screen buttons. It would be greatly appreciated if you could help me with how to call the function “Q\_INVOKABLE void sendCommand(…)” in Vehicle.h from qml. I tried the following, but didn´t work:

```auto
import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0

property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle

QGroundControl.vehicle.sendCommand(_activeVehicle, //Component to send to
                                   183, //MAV_CMD to send 183:MAV_CMD_DO_SET_SERVO
                                   true, //showError
                                   7, //servo instance
                                   1500) //servo value in us

```

I get the error “TypeError: Cannot call method ‘sendCommand’ of undefined” in the QGC console.

---

<div class="post-metadata">

**Author:** ![stryngs](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@stryngs](https://discuss.cubepilot.org/u/stryngs)\
**Post date:** [18 April 2023 06:39 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/9 "2023-04-18T06:39:00Z")

</div>

I tried to disable this tonight. It is greyed out. I am in developer mode but I feel this is a root thing. I’m making a guess the port is on 14550 that is bound. What does it take paperwork wise to get this access?

---

<div class="post-metadata">

**Author:** ![stryngs](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@stryngs](https://discuss.cubepilot.org/u/stryngs)\
**Post date:** [18 April 2023 07:02 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/10 "2023-04-18T07:02:29Z")

</div>

The solution I found is Application Settings | Comm Links | Add | UDP on port 14551.

It was as much a guess as it was I think I’ve seen 14551 floating around somewhere.

## Can confirm this works and connects to a Herelink. My question now revolves around the differences between: [GitHub - mavlink/qgroundcontrol: Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)](https://github.com/mavlink/qgroundcontrol)

> **[GitHub - CubePilot/qgroundcontrol-herelink](https://github.com/CubePilot/qgroundcontrol-herelink)**
>
> Contribute to CubePilot/qgroundcontrol-herelink development by creating an account on GitHub.

Are there any safety of flight concerns or is it more a matter of taste, etc?

Thanks!

---

<div class="post-metadata">

**Author:** ![Andrew\_Wilkins](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/andrew_wilkins/32/5663_2.png) [@Andrew\_Wilkins](https://discuss.cubepilot.org/u/Andrew_Wilkins)\
**Post date:** [10 May 2023 21:34 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/11 "2023-05-10T21:34:34Z")

</div>

Is there any documentation on this? I believe that QGC herelink is using qgc 4.0.0.

The instructions on how to compile QGC 4.0.0 are no longer available.

Any insight into the build process would be appreciated

---

<div class="post-metadata">

**Author:** ![Andrew\_Wilkins](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/andrew_wilkins/32/5663_2.png) [@Andrew\_Wilkins](https://discuss.cubepilot.org/u/Andrew_Wilkins)\
**Post date:** [15 May 2023 16:47 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/12 "2023-05-15T16:47:44Z")

</div>

@philip @Michael_Oborne  
Apologies for the direct tag, but was hoping you could point us in the correct direction. We would be happy to produce some documentation on how QGC-herelink is compiled (for future users who would like to), but we are struggling.

We would be happy to pay for your time. Or, if there is a jenkins pipeline or anything setup that we can glean this information from we would be happy to do that.

Thank you!

---

<div class="post-metadata">

**Author:** ![Michael\_Oborne](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/michael_oborne/32/13_2.png) [@Michael\_Oborne](https://discuss.cubepilot.org/u/Michael_Oborne)\
**Post date:** [15 May 2023 18:11 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/13 "2023-05-15T18:11:07Z")

</div>

There is a GitHub ci pipeline setup in the repo, I would refer you to that

---

<div class="post-metadata">

**Author:** ![Andrew\_Wilkins](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/andrew_wilkins/32/5663_2.png) [@Andrew\_Wilkins](https://discuss.cubepilot.org/u/Andrew_Wilkins)\
**Post date:** [15 May 2023 18:40 UTC](https://discuss.cubepilot.org/t/how-to-compile-qgc-herelink/6913/14 "2023-05-15T18:40:30Z")

</div>

Thank you Michael!
