Qgroundcontrol build fails everytime

Expected Behavior

Build the qgroundcontrol.pro in qt creator without errors after cloning from GitHub

Current Behavior

Fail to build QGC on windows

Steps to Reproduce:

Please provide an unambiguous set of steps to reproduce the current behavior

  1. Build with Qt Creator

System Information

When posting bug reports, include the following information

Detailed Description

** I am new to this and nor do I code **

The very first error I come across as I run the .pro file without any changes is

#pragma warning(pop, 0)
_C:\Users\Mavrick\Desktop\QGC\qgroundcontrol\src\comm\QGCMAVLink.h:42:
error: #pragma warning expected ')' [-Werror,-Wunknown-pragmas]
#pragma warning(pop, 0)"_ 

Tried to find what it means - the search ends up empty so changed it to the following based on CPP reference:

#pragma warning(pop)

Next I got jom errors and some developers suggested to use nmake instead but I still keep getting the following exit code:

clang-cl: error: argument unused during compilation: '-MP' [-Werror,-Wunused-command-line-argument]
jom: C:\Users\Mavrick\Desktop\QGC\build-qgroundcontrol-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug\Makefile [QGCMapEngine.obj] Error 1
01:59:25: The process "C:\Qt\Tools\QtCreator\bin\jom\jom.exe" exited with code 2.
Error while building/deploying project qgroundcontrol (kit: Desktop Qt 5.15.2 MSVC2019 64bit)
When executing step "Make"

Log Files and Screenshots

(Redirecting to latest version of document (master))

:-1: error: argument unused during compilation: '-MP' [-Werror,-Wunused-command-line-argument]
jom: C:\Users\Mavrick\Desktop\QGC\build-qgroundcontrol-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug\Makefile [QGroundControl_pch.obj] Error 1
1 Like

Painful isn’t it.

Did you install all the dependencies listed in Getting Started with source & builds · QGroundControl Developer Guide ?

I set this up from scratch two weeks ago (Windows 11 etc) following the instructions and it worked fine. The only thing that gave me problems were that the submodule update did not work properly. I fixed that by doing a git submodule init

PS I also got the Linux and Docker instructions to work. I did not succeed with vagrant.

I did struggle with the dependencies a little at first. I really don’t know if I have everything in place. What should I share with you so that you know that I have all the dependencies installed right?

All I did was follow those links carefully. I don’t know what this error means. I think you need to copy your FULL build log into a gist or similar and cross link it. That will give someone more expert than me a chance to work out what is going on.

Note to other readers, issue for this created here: qgeoundcontrol source code build fail · Issue #10275 · mavlink/qgroundcontrol · GitHub

HI, vbutala,

I’m running qgroundcontrol daily with following configuration on windows 11.

  1. Qt 5.15.0 MSVC 2015 (also installed qt 5.15.2 and MSVC 2015-17)
  2. Visual studio C++ 2017
  3. Import from github in qt.

If your reading project starts with red line it means your configuration is not right.