Mavlink v2 + Qgroundcontrol compatibility problem (possible compiler issue)

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

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

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

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

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.