protobuf compatibility with windows 11 with superbuild

Hey !
I am rebuilding the dll to have some specific features in a recent branch of pulse (features/ventilator-update). I wanted to share a bug I found, and the solution to fix it.

I am compiling with Visual Studio 2022 (x64 native compiler) on windows 11. My protobuf version is 23,7 i.e. the latest LTS. Ive been able to generate the solution with CMake without problem. However, when trying to build this solution, I get an error related to protobuf.

In fact, it is related to a change in windows that makes several variables not anymore “compatible” :

The fix has not been pushed to event the 28.0 RC2.0 that is the latest non lts version. It has been merged 2 weeks ago, but no tag include it ([upb] Fixed NAN/INFINITY definitions to work on Windows 11 SDK by Cheney-W · Pull Request #40039 · microsoft/vcpkg · GitHub)

So, I manually update the message.c script (path: …\External\protobuf\src\upb\message\internal\message.c), what solved the problem… but it is really manual ; lets hope it will be fixed soon in protobuf directly.

Cheers!

Thanks for looking into this!

I had not upgraded to Win SDK 10.0.26100 yet

As soon as protobuf puts out a new release with this fix, I will update our CMake build

You can tell CMake the Win SDK you want to use.
In this example, I am setting it to use the SDK 10.0.22621, the one before 10.0.26100
Note: The CMAKE_SYSTEM_VERSION should be set on the command line on the first configuration of a new build tree. Here I just clicked Add Entry before I clicked the Configure button

You can check what SDK is being used (As well as what SDK’s you have installed, use a string in this list as the value of the CMAKE_SYSTEM_VERSION variable above) by looking at the project properties.
Note, if you change the SDK in the outer build Properties Page, it will not push that change to the dependent builds. You have to change it in CMake, since its creating these dependent builds.