Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
When I try to compile WpfGfx, I get a number of C++ static_cast errors in
Large number of repeated errors (see attached binlog).
It should build.
If a commit successfully builds on Microsoft's build servers (for the purposes of validating a PR, for e.g.), it should pretty much build for anyone.
The PR builds have nothing special going on - they are just running latest preview versions of Visual studio on a Win10[-ish] build machine, create a fresh clone and run something like
When trying to build a commit like eb6fca3, its reasonable to presume that should build (because otherwise it would not have been merged automatically).
I haven't seem problems like the one you've reported in that part of the codebase. That code - though heavy in use of templates etc. - used to build just fine using VS 2017 class compilers as-is (and continues to build ok for several developers and on many build-machines on VS2019 compilers over the past years). This reads like a dev-machine configuration problem to me. Unfortunately, I can't say what's going on from our logs...
your binlog contains lines like these which stand out to me:
Don't know if thats a red herring or if you are missing an optional component in your VS install.
Unrelated to your particular problem but maybe useful for future readers who want to diagnose build problems: if the
I'm building unelevated sucessfully.
I don't have a lot of experience troubleshooting C++ failures remotely, but I'll try :-)
https://support.microsoft.com/en-za/help/974229/troubleshooting-for-the-microsoft-visual-c-compiler-or-the-visual-c-li describes how to create a reproducible preprocessor output that can be used to reproduce the compilation errors.
You can extract the failing cl.exe command from the msbuild binary log, and re-run it in a Visual Studio Developer Command Prompt while supplying additional switches as outlined in the article.
This could help us compare results in a more fine-grained manner and then back-track to the source of divergence.
/cc @tgani-msft for additional suggestions.
Found it! I had modified the C++ projects to build with the 18362 Windows SDK, as that's what I build all my other projects with. However, WPF actually does require the 17134 SDK, and will not compile with any newer version. When I installed that specific SDK version and rebuilt, WpfGfx compiled just fine. Thanks for all your help!