Error when trying to build QGC

Hi all,

After following the guide:
i opened up the file in qt creator and tried to build and run the code, however i keep coming up with these errors

error: C2220: warning treated as error - no ‘object’ file generated


:-1: error: Failed to retrieve MSVC Environment from “C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat x86”:
The command “C:\Windows\system32\cmd.exe” could not be started.

Is there any simple way i can rectify this? Appreciate if anyone could help me out!

Does the path to vcvarsall.bat on you computer not exist? If so how does it differ?

Hi Don,

the vcvarsall.bat exists in the path, this error doesnt appear everytime though

However, the error C2220 still pops up everytime i try to compile it…


Just tried compiling again and it shows this error

Take a look at Compile Output tab instead which should provide more context as to where this is coming from

Thanks for the quick replies!
It seems the error comes from;
Cannot find file: QMAKE_CXXFLAGS.
Cannot find file: \WX.

but i am not very sure what that means…

First this is that released version of QGC use Qt 5.12.5, there is a Qt bug in 5.12.6 which will prevent vehicle connections. This was found at the last minute and the docs are still catching up. That said I doubt this would cause this problem.

Why qmake is failing I can’t sat. My only guess is that there may be a problem with non-video builds. You don’t have the video streaming depencies installed. Try installing those.

My apologies, the qmake error was because there was an additional argument.
After building it again, it shows:

C2220: warning treated as error - no ‘object’ file generated
C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss

The compile output just shows the elapsed time

Ah, interesting. We don’t see that in our CI runs. So specific to OS setup. I’ll remove that.

Is there a fix for error C2220 and C4819? Still cant build so far…
One of it involves QGCTileCacheWorker.cpp line 719

Just remove the comment which has the bad character in it

I just tried deleting all the files and building the source code all over again.
error C2220 still stands but im also getting a new error:

C:\Users\User\Desktop\Github\ardupilot\qgroundcontrol\custom\src\ error: C2259: ‘CustomVideoReceiver’: cannot instantiate abstract class

My guess for the previous errors was because i had the deafult Qgroundcontrol installed on my system as well so the build was affected (now deleted but having the above errors)

Any idea on how to fix?
error: C2259: ‘CustomVideoReceiver’: cannot instantiate abstract class

There may be bugs in the custom example since that is not built in CI. Please file a GitHub issue on that and we’ll get it fixed