Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New VS 2017 compiler fails build with WarningsAsErrors on #8401

Closed
zk317 opened this issue Feb 24, 2020 · 14 comments
Closed

New VS 2017 compiler fails build with WarningsAsErrors on #8401

zk317 opened this issue Feb 24, 2020 · 14 comments
Assignees

Comments

@zk317
Copy link

zk317 commented Feb 24, 2020

<C2220 error in QGCTileCacheWorker.cpp. Version 4.0 upgrade error?>

2

Hey, I'm having fun watching your work.

I wanted to try it too, but when I built it, I ran into problems.
(I didn't fix anything)

I get a C2220 error in QGCTileCacheWorker.cpp

In addition, many files produce C4996 and C7567 errors.

I installed it as described in the link below.

https://dev.qgroundcontrol.com/en/getting_started/

I installed Visual Basic 2017 version Desktop development with C ++ and qt 5.12.5 MSVC 2017 64 64bit.

git clone <https://github.com/mavlink/qgroundcontrol.git --recursive>

Download the source with the command.

I tried to reinstall it several times, but I get a comprehensive error such as C2220 error.

I seems to be something wrong with the version.

If you look for these errors on Google, and you don't see the same case, it might be because of a version update?

....

I found it in gitter
<I read that "QGC is currently built against Qt 5.12.6 (all OS) .Also Windows has moved to VS 2017 and 64 bit only.Docs updates may be a bit behind since I haven't had time.>

So I deleted and reinstalled Qt5.12.5.
same.

I rebuilt the window.
same.

It sure seems like a compiler problem.

I tried to reinstall the compiler with version 15.9 of 2015, so I tried version 15.0.
same.

I also checked Qt's kit several times.

1

Project MESSAGE: Qt version 5.12.6
Project MESSAGE: Windows build
Project MESSAGE: QGroundControl Development master:af92e00e6 2020-02-23 11:01:49 +0000
Project MESSAGE: Debug flavor
Project MESSAGE: Using Default QtLocation headers
Project MESSAGE: Skipping support for Pairing
Project MESSAGE: Using MAVLink dialect 'ardupilotmega'.
Project MESSAGE: Skipping support for Zeroconf (unsupported platform)
Project MESSAGE: Looking for Airmap in folder "C:/Users/CTS/qgroundcontrol/libs/airmapd", variant: "Qt.5.12"
Project MESSAGE: Skipping support for Airmap (unsupported platform)
Project MESSAGE: Taisync disabled
Project MESSAGE: Microhard disabled
Project MESSAGE: Skipping support for video streaming (GStreamer libraries not installed)
Project MESSAGE: Installation instructions here: https://github.com/mavlink/qgroundcontrol/blob/master/src/VideoStreaming/README.md
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!
Cannot read C:/Users/CTS/qgroundcontrol/user_config.pri: No such file or directory

What is the problem?
Are you going too fast?

@zk317 zk317 changed the title C2220 error in QGCTileCacheWorker.cpp, many files produce C4996 and C7567 errors. Build Error <C2220 error in QGCTileCacheWorker.cpp ....> Feb 24, 2020
@DonLakeFlyer
Copy link
Contributor

I don't think you have the right compilers set up:
Screen Shot 2020-02-24 at 9 44 19 AM

@zk317
Copy link
Author

zk317 commented Feb 25, 2020

Thanks for the answer
If I solve this problem, I'll work hard to update the development guide sheet!

But right now the problem is not solved ...

I didn't get to version 15.9, but I did it again after seeing the answer you gave me.
I wanted to install the compiler language in English
It didn't work out ... (see screenshot)

Untitled-1

I think now

  • Qt5.12.6 installation from the web (I proceeded with a 3.6GB offline installation from the archive)
  • I'm going to install Visual Studio 2017 15.9 other than Community.
  • I'm thinking about moving to Linux if that doesn't work.

@zk317
Copy link
Author

zk317 commented Feb 25, 2020

Hi guys!

As mentioned above, I have reinstalled qt, the compiler, and Windows with various versions and roots.

Eventually it failed with the same error.

But I did not give up.

We have installed Ubuntu Linux.

2020-02-25 23-29-07

amazing!
New updates every day!

Unfortunately I can't build a development environment on Windows.
I'm glad you're doing well on Linux.

By the way, I don't know how to distribute Linux.
I know exactly Windows, but I'm new to Linux.

So .... Why can't only hybrids work in the mapbox?
I confirmed that it works fine on Windows.

@DonLakeFlyer
Copy link
Contributor

Wait I didn't realize C2220 turns warnings into errors. You can do that with current QGC source. Did you turn that on yourself?

@zk317
Copy link
Author

zk317 commented Feb 26, 2020

I didn't understand exactly what you mean.
What do you want me to do?
Are you going to replace the error with a warning and run it?
I'm ready to come to Windows anytime!

But on Linux, it crashes because of an irregular crashed error.
Master is the latest version
I don't know what's wrong with the error.
Are there any logs left except qt messages?

@zk317
Copy link
Author

zk317 commented Feb 26, 2020

If you run it with .sh you get an error code,
I'll add this to the issue category separately.

And "Wait I didn't realize C2220 turns warnings into errors.You can do that with current QGC source. Did you turn that on yourself?" If you explain what this means, I'll help you as much as I can.

I'm always thankful

@DonLakeFlyer
Copy link
Contributor

Sorry I forgot that the Windows build compiles by default with WarningsAsErrors on so it compiles with the /WX flag. Which will fail the build with a C2220 error if there is a compiler warning. It looks like the compiler you are using is newer than the one we are using hence it has new warning checks in it which are now failing which didn't before.

I think the reason may be because of this: "Visual Basic 2017 version Desktop development with C ++ and qt 5.12.5 MSVC 2017 64 64bit." The VB version may install something newer than if you just use the regular C++ install as outlined in the docs.

@DonLakeFlyer DonLakeFlyer self-assigned this Feb 27, 2020
@DonLakeFlyer DonLakeFlyer added this to the Release v4.0 milestone Feb 27, 2020
@DonLakeFlyer
Copy link
Contributor

Did some more digging looks like the compiler was updated in newer VS 2017 versions. So these warnings are new in that version. I'll get them fixed up.

@DonLakeFlyer DonLakeFlyer changed the title Build Error <C2220 error in QGCTileCacheWorker.cpp ....> New VS 2017 compiler fails build with WarningsAsErrors on Feb 27, 2020
@DonLakeFlyer
Copy link
Contributor

I upgraded VS and got a new compiler. What I get from the standard C++ install is still a little older then what you have. And when I recompile I sitll don't get those errrors. Hmm

@DonLakeFlyer DonLakeFlyer modified the milestones: Release v4.0, Release V4.1 Mar 1, 2020
@zk317
Copy link
Author

zk317 commented Mar 2, 2020

I didn't monitor this post because I knew it couldn't be fixed.
I erased all the files on Windows.
I will test it in Windows environment and leave a reply as soon as possible.

@x-tools-author
Copy link
Contributor

You should remove the -WX option of CXXFLAGS from the makefile, which on the output directory of Qt Creator. @zk317

@zk317
Copy link
Author

zk317 commented Apr 8, 2020

You should remove the -WX option of CXXFLAGS from the makefile, which on the output directory of Qt Creator.


thank you. Well solved.

I have confirmed that it works fine on Windows.

Thank you all.

@zk317 zk317 closed this as completed Apr 8, 2020
@dhruv-mehta99
Copy link

i am a noob in Qground control i m also getting this c2220 error so finally how should i sovle it?

@zk317
Copy link
Author

zk317 commented May 16, 2020

In my case, it was solved by setting WX option of CXXFLAGS.
If you install the master version now, it will work well without taking the above measures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants