# Error when trying to build QGC

**URL:** <https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808>\
**Category:** Development\
**Created:** [March 22, 2020, 6:28pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808 "2020-03-22T18:28:14Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![NectroX](https://discuss.px4.io/user_avatar/discuss.px4.io/nectrox/32/5828_2.png) [@NectroX](https://discuss.px4.io/u/NectroX)\
**Post date:** [March 22, 2020, 6:28pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/1 "2020-03-22T18:28:14Z")

</div>

Hi all,

After following the guide: [Redirecting to latest version of document (master)](https://dev.qgroundcontrol.com/en/getting_started/)  
i opened up the qgroundcontrol.pro file in qt creator and tried to build and run the code, however i keep coming up with these errors

 ![error](https://discuss.px4.io/uploads/default/original/2X/e/eb5b911b45d5ed1a07eb075c6e69d45f25cea49b.png)

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

and

👎 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!

---

<div class="post-metadata">

**Author:** ![DonLakeFlyer](https://discuss.px4.io/user_avatar/discuss.px4.io/donlakeflyer/32/3036_2.png) [@DonLakeFlyer](https://discuss.px4.io/u/DonLakeFlyer)\
**Post date:** [March 23, 2020, 4:01pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/2 "2020-03-23T16:01:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NectroX](https://discuss.px4.io/user_avatar/discuss.px4.io/nectrox/32/5828_2.png) [@NectroX](https://discuss.px4.io/u/NectroX)\
**Post date:** [March 23, 2020, 4:16pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/3 "2020-03-23T16:16:35Z")

</div>

Hi Don,

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

 ![bat](https://discuss.px4.io/uploads/default/original/2X/c/c9642ed0eb01469e9bd9859dd6d02d8897c3e2f8.png)

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

Update:

Just tried compiling again and it shows this error

 ![assignment](https://discuss.px4.io/uploads/default/original/2X/7/7d180d662e1dc7256ba35cf7ad6965134753adad.png)

---

<div class="post-metadata">

**Author:** ![DonLakeFlyer](https://discuss.px4.io/user_avatar/discuss.px4.io/donlakeflyer/32/3036_2.png) [@DonLakeFlyer](https://discuss.px4.io/u/DonLakeFlyer)\
**Post date:** [March 23, 2020, 5:09pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/4 "2020-03-23T17:09:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NectroX](https://discuss.px4.io/user_avatar/discuss.px4.io/nectrox/32/5828_2.png) [@NectroX](https://discuss.px4.io/u/NectroX)\
**Post date:** [March 23, 2020, 5:26pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/5 "2020-03-23T17:26:53Z")

</div>

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

but i am not very sure what that means…

 ![compile output](https://discuss.px4.io/uploads/default/original/2X/5/532b6a3c3dd463c376264754b401086c43c02ff3.png)

---

<div class="post-metadata">

**Author:** ![DonLakeFlyer](https://discuss.px4.io/user_avatar/discuss.px4.io/donlakeflyer/32/3036_2.png) [@DonLakeFlyer](https://discuss.px4.io/u/DonLakeFlyer)\
**Post date:** [March 23, 2020, 7:18pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/6 "2020-03-23T19:18:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NectroX](https://discuss.px4.io/user_avatar/discuss.px4.io/nectrox/32/5828_2.png) [@NectroX](https://discuss.px4.io/u/NectroX)\
**Post date:** [March 24, 2020, 2:33pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/7 "2020-03-24T14:33:59Z")

</div>

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  
and  
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

 ![Untitled](https://discuss.px4.io/uploads/default/original/2X/c/c0022a2bdb39e38c9b4f57a265eaeae76e29bb69.png)  
The compile output just shows the elapsed time

 ![build settings](https://discuss.px4.io/uploads/default/original/2X/e/e35d0a8d3bc8cbffabdfd4fbba0d7e935b95ae8e.png)

---

<div class="post-metadata">

**Author:** ![DonLakeFlyer](https://discuss.px4.io/user_avatar/discuss.px4.io/donlakeflyer/32/3036_2.png) [@DonLakeFlyer](https://discuss.px4.io/u/DonLakeFlyer)\
**Post date:** [March 24, 2020, 5:09pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/8 "2020-03-24T17:09:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NectroX](https://discuss.px4.io/user_avatar/discuss.px4.io/nectrox/32/5828_2.png) [@NectroX](https://discuss.px4.io/u/NectroX)\
**Post date:** [March 24, 2020, 5:25pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/9 "2020-03-24T17:25:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DonLakeFlyer](https://discuss.px4.io/user_avatar/discuss.px4.io/donlakeflyer/32/3036_2.png) [@DonLakeFlyer](https://discuss.px4.io/u/DonLakeFlyer)\
**Post date:** [March 24, 2020, 5:30pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/10 "2020-03-24T17:30:45Z")

</div>

Just remove the comment which has the bad character in it

---

<div class="post-metadata">

**Author:** ![NectroX](https://discuss.px4.io/user_avatar/discuss.px4.io/nectrox/32/5828_2.png) [@NectroX](https://discuss.px4.io/u/NectroX)\
**Post date:** [March 24, 2020, 5:54pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/11 "2020-03-24T17:54:47Z")

</div>

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:

 ![rebuilt](https://discuss.px4.io/uploads/default/original/2X/7/771078fc5a90734fce605d6c1103f1b794a99b5b.png)

C:\Users\User\Desktop\Github\ardupilot\qgroundcontrol\custom\src\CustomPlugin.cc:206: 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)

---

<div class="post-metadata">

**Author:** ![NectroX](https://discuss.px4.io/user_avatar/discuss.px4.io/nectrox/32/5828_2.png) [@NectroX](https://discuss.px4.io/u/NectroX)\
**Post date:** [March 26, 2020, 3:08pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/12 "2020-03-26T15:08:11Z")

</div>

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

 ![class](https://discuss.px4.io/uploads/default/original/2X/8/896ed8eb1e60dec2bb0b4cddf2ed8565fbf2764f.png)

---

<div class="post-metadata">

**Author:** ![DonLakeFlyer](https://discuss.px4.io/user_avatar/discuss.px4.io/donlakeflyer/32/3036_2.png) [@DonLakeFlyer](https://discuss.px4.io/u/DonLakeFlyer)\
**Post date:** [March 26, 2020, 3:10pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/13 "2020-03-26T15:10:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kemen209](https://discuss.px4.io/user_avatar/discuss.px4.io/kemen209/32/7072_2.png) [@kemen209](https://discuss.px4.io/u/kemen209)\
**Post date:** [September 25, 2020, 3:58am UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/14 "2020-09-25T03:58:55Z")

</div>

Hi, i have an idea about the reason why there is no building problem with video-build but have building issue(C2220 and C4819) on non-video-build.

If the video streaming is enabled(gstreamer installed), qmlglsink.pri will be included. And qmlglsink.pri will set QMAKE\_CXXFLAGS\_WARN\_ON to empty, which result the /WX flag(C2220) been removed, and in turn no warning treated as error.

And indeed, the real reason is what C2220 and C4819 indicated - building the QGC with some bad character in source files can not be represented in some code page(like 932). So remove the bad chars are the right way to go.

---

<div class="post-metadata">

**Author:** ![DonLakeFlyer](https://discuss.px4.io/user_avatar/discuss.px4.io/donlakeflyer/32/3036_2.png) [@DonLakeFlyer](https://discuss.px4.io/u/DonLakeFlyer)\
**Post date:** [October 4, 2020, 10:58pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/15 "2020-10-04T22:58:31Z")

</div>

@kemen209 Can you enter a GitHub issue with the details on this including how to reproduce the build failure and I’ll fix it.

---

<div class="post-metadata">

**Author:** ![Robinson\_M\_aka\_Rokit](https://discuss.px4.io/user_avatar/discuss.px4.io/robinson_m_aka_rokit/32/7171_2.png) [@Robinson\_M\_aka\_Rokit](https://discuss.px4.io/u/Robinson_M_aka_Rokit)\
**Post date:** [October 10, 2020, 3:37pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/16 "2020-10-10T15:37:48Z")

</div>

I am facing an error, Kindly help me fix:

Error while parsing file /home/rokit/qgroundcontrol/qgroundcontrol.pro. Giving up.  
Project ERROR: License check failed! Giving up …

---

<div class="post-metadata">

**Author:** ![yangzhou](https://discuss.px4.io/letter_avatar_proxy/v4/letter/y/eb8c5e/32.png) [@yangzhou](https://discuss.px4.io/u/yangzhou)\
**Post date:** [December 11, 2020, 2:32pm UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/17 "2020-12-11T14:32:13Z")

</div>

@NectroX ，Hello, I have the same problem with you. Have you solved the problem? How did it work out?

---

<div class="post-metadata">

**Author:** ![Raghavi\_BR](https://discuss.px4.io/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@Raghavi\_BR](https://discuss.px4.io/u/Raghavi_BR)\
**Post date:** [July 13, 2023, 7:28am UTC](https://discuss.px4.io/t/error-when-trying-to-build-qgc/15808/18 "2023-07-13T07:28:59Z")

</div>

I was trying to **build the QGC** but I’m getting this **issues** regularly, if I **Use Clean tool.**.it will wash-off and again **after the run its appearing**. what should i suppose to do with this? 😐

 ![qgc issues](https://discuss.px4.io/uploads/default/original/2X/1/144a09449115ceaa9a03ba2f5bc9f10694ec2412.png)
