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

Errors while building the Windows SDK (x86): "error C2220: the following warning is treated as an error" #2581

Open
vlad-mal opened this issue Jul 10, 2021 · 2 comments

Comments

@vlad-mal
Copy link

vlad-mal commented Jul 10, 2021

Hello.

OS: Win10 x64 Pro, IDE: Microsoft Visual Studio Community Edition.

When building SDK for Windows (x86), using the method described in the Read.me file (https://github.com/meganz/sdk/blob/master/README.md):

cmake -DTRIPLET=x86-windows-mega-staticdev -DEXTRA_ARGS="-DUSE_PDFIUM=0" -P build_from_scratch.cmake

All 3rd-party components are built without problems, however, when building the mega sdk itself, errors appear:
error C2220: the following warning is treated as an error
... followed by warnings, mainly related to comparing signed and unsigned integer types, for example
warning C4018: '> =': signed / unsigned mismatch

Analysis showed that the crash is due to the fact that mega sdk projects are built with the /W4 and /WX compiler switches. In previous versions of mega sdk, the assembly was performed with the keys /W3 and /WX-. Fix please.

Thank you. Best regards, Vladimir Malinovsky.

@vlad-mal
Copy link
Author

vlad-mal commented Jul 10, 2021

OK I understood. And so it was conceived.
The file \sdk\CMakeLists.txt contains the following lines:

 # warnings as errors, just for windows builds, as warnings keep creeping in. Best if we address them once in the original MRs.
 set (CMAKE_CXX_FLAGS_DEBUG "$ {CMAKE_CXX_FLAGS_DEBUG} /WX")

That is, you just need to comment out the second line:
# set (CMAKE_CXX_FLAGS_DEBUG "$ {CMAKE_CXX_FLAGS_DEBUG} /WX")
Could have warned, because I spent the whole evening looking for an error. Thank you.

@mattw-mega
Copy link
Contributor

Thanks for letting us know, most of our automated processes are on x64 nowadays. In the meantime, as you discovered, you can easily switch /WX off. thanks

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

2 participants