# Mavlink v2 + Qgroundcontrol compatibility problem (possible compiler issue)

**URL:** <https://discuss.px4.io/t/mavlink-v2-qgroundcontrol-compatibility-problem-possible-compiler-issue/957>\
**Category:** Uncategorized\
**Created:** [August 16, 2016, 10:42pm UTC](https://discuss.px4.io/t/mavlink-v2-qgroundcontrol-compatibility-problem-possible-compiler-issue/957 "2016-08-16T22:42:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_Garret\_Sulliv](https://discuss.px4.io/user_avatar/discuss.px4.io/joseph_garret_sulliv/32/365_2.png) [@Joseph\_Garret\_Sulliv](https://discuss.px4.io/u/Joseph_Garret_Sulliv)\
**Post date:** [August 16, 2016, 10:42pm UTC](https://discuss.px4.io/t/mavlink-v2-qgroundcontrol-compatibility-problem-possible-compiler-issue/957/1 "2016-08-16T22:42:14Z")

</div>

Hello everyone,

I’m working on a quadrotor project that is using px4 and qGroundControl as my GCS. To satisfy my project requirements I have implemented additional mavlink messages and integrated this messages into the GCS.

For the last day I have been updating my local source repositories to Mavlink V2. I have been unable to build QGroundControl from source since integrating the Mavlink v2 c library; the macro MAVLINK\_MESSAGE\_CRCS breaks compilation using GCC 4.8.4 (64-bit) with the C++11 standard.

The macro in question is an auto generated aggregate initializer, found in any dialect header, such as common.h.

Here is the error I am receiving:

/qgroundcontrol/libs/mavlink/include/mavlink/v2.0/smellocopter/smellocopter.h:23:3426: error: braces around scalar initializer for type ‘uint8\_t {aka unsigned char}’

I am not a software development expert, so I’m quite puzzled by the issue. Maybe there is a problem with my QT creator kit setup?

Any of your thoughts / insight would be most helpful.

Best Regards,  
Joseph Sullivan

---

<div class="post-metadata">

**Author:** ![Joseph\_Garret\_Sulliv](https://discuss.px4.io/user_avatar/discuss.px4.io/joseph_garret_sulliv/32/365_2.png) [@Joseph\_Garret\_Sulliv](https://discuss.px4.io/u/Joseph_Garret_Sulliv)\
**Post date:** [August 17, 2016, 5:51pm UTC](https://discuss.px4.io/t/mavlink-v2-qgroundcontrol-compatibility-problem-possible-compiler-issue/957/2 "2016-08-17T17:51:31Z")

</div>

Just to provide some more info; the offending line of code in the QGC source is in MAVLinkProtocol.cc

```
../qgroundcontrol/src/comm/MAVLinkProtocol.cc:448:39: note: in expansion of macro 'MAVLINK_MESSAGE_CRCS'
     static uint8_t messageKeys[256] = MAVLINK_MESSAGE_CRCS;
```

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [August 22, 2016, 7:59pm UTC](https://discuss.px4.io/t/mavlink-v2-qgroundcontrol-compatibility-problem-possible-compiler-issue/957/3 "2016-08-22T19:59:57Z")

</div>

As far as I can tell QGC still uses the v1.0 Mavlink headers.

```auto
static uint8_t messageKeys[256] = 

```

expects the v1.0 format of the macro, but you are including the v2.0 headers, for which the macro `MAVLINK_MESSAGE_CRCS` has a different & incompatible format. I suggest you try to use the v1.0 headers and see if that works.

cheers
