# protobuf compatibility with windows 11 with superbuild

**URL:** <https://discourse.kitware.com/t/protobuf-compatibility-with-windows-11-with-superbuild/1333>\
**Category:** Pulse Physiology Engine\
**Created:** [August 10, 2024, 6:52pm UTC](https://discourse.kitware.com/t/protobuf-compatibility-with-windows-11-with-superbuild/1333 "2024-08-10T18:52:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LauranneSins](https://discourse.kitware.com/user_avatar/discourse.kitware.com/laurannesins/32/883_2.png) [@LauranneSins](https://discourse.kitware.com/u/LauranneSins)\
**Post date:** [August 10, 2024, 6:52pm UTC](https://discourse.kitware.com/t/protobuf-compatibility-with-windows-11-with-superbuild/1333/1 "2024-08-10T18:52:04Z")

</div>

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” :

- [Issues · grpc/grpc · GitHub](https://github.com/grpc/grpc/issues/37210:) upb\_message\_lib (message.c) cannot compile with VS: initializer is not a constant
- [Sign in to GitHub · GitHub](https://github.com/protocolbuffers/protobuf/pull/17471:) Fixed `NAN`/`INFINITY` definitions to work on Windows 11 SDK.

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](https://github.com/microsoft/vcpkg/pull/40039))

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!

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [August 14, 2024, 1:16pm UTC](https://discourse.kitware.com/t/protobuf-compatibility-with-windows-11-with-superbuild/1333/2 "2024-08-14T13:16:38Z")

</div>

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

 ![image](https://discourse.kitware.com/uploads/default/original/1X/5e88770890b4c0a9dc9c7663ecba3bf891897adc.png)

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.

 ![image](https://discourse.kitware.com/uploads/default/original/1X/2818d0485d1e42d18288a57d42be7132605aaedb.png)
