# Build error: VTK 9.6.0 rc3, vtkResourceStream.cxx line79, std::min, MSVS 14.44/x86/Debug

**URL:** https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280
**Category:** Development
**Tags:** build
**Created:** [February 9, 2026, 1:05am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280 "2026-02-09T01:05:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![francek](https://discourse.vtk.org/user_avatar/discourse.vtk.org/francek/32/10505_2.png) [@francek](https://discourse.vtk.org/u/francek)
#### Post date: [February 9, 2026, 1:05am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/1 "2026-02-09T01:05:12Z")

</div>

Hi,

I tried to build VTK 9.6.0 rc3 for Win32/x86 and Debug target, but the build failed.

In vtkResourceStream.cxx, std::min is called with parameters of different types.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/0/0071c56c2601f46a94265b5bab9de0a1ba0c64bb.png)

```auto
260208_vtk_9.6.0.rc3\IO\Core\vtkResourceStream.cxx(79,46): error C2672: 'std::min': no matching overloaded function found
192> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\utility(109,26):
192> could be '_Ty std::min(std::initializer_list<_Elem>)'
192> C:\Users\built\libs\vtk\260208_vtk_9.6.0.rc3\IO\Core\vtkResourceStream.cxx(79,46):
192> '_Ty std::min(std::initializer_list<_Elem>)': expects 1 arguments - 2 provided
192> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\utility(106,26):
192> or '_Ty std::min(std::initializer_list<_Elem>,_Pr)'
192> C:\Users\built\libs\vtk\260208_vtk_9.6.0.rc3\IO\Core\vtkResourceStream.cxx(79,46):
192> '_Ty std::min(std::initializer_list<_Elem>,_Pr)': could not deduce template argument for 'std::initializer_list<_Elem>' from 'const ptrdiff_t'
192> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\utility(98,6):
192> or 'const _Ty &std::min(const _Ty &,const _Ty &) noexcept(<expr>)'

```

After casting ‘available’ to (long long) the VTK built Okay.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/a/a208304c3ddb786af1e9054133f88e8f9c98e027.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [February 9, 2026, 1:28am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/2 "2026-02-09T01:28:45Z")

</div>

We need to `#define NOMINMAX` before including `windows.h`.

Can you apply this patch and see how many other places need an update as well (same diff should fix it, right at the top of the main `.cxx` file bing compiled before the first `#include`).

```diff
diff --git i/IO/Core/vtkResourceStream.cxx w/IO/Core/vtkResourceStream.cxx
index 4790d63f03..c9c6e9535d 100644
--- i/IO/Core/vtkResourceStream.cxx
+++ w/IO/Core/vtkResourceStream.cxx
@@ -1,5 +1,11 @@
 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
 // SPDX-License-Identifier: BSD-3-Clause
+
+#ifdef _WIN32
+// Disable min/max macros from `windows.h`.
+#define NOMINMAX
+#endif
+
 #include "vtkResourceStream.h"

 #include <algorithm>

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [February 9, 2026, 1:29am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/3 "2026-02-09T01:29:17Z")

</div>

Ah, I see that after your fix everything else was fine now. I’ll submit this diff.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [February 9, 2026, 1:31am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/4 "2026-02-09T01:31:47Z")

</div>

[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/12902](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12902)

---

<div class="post-metadata">

### Author: ![francek](https://discourse.vtk.org/user_avatar/discourse.vtk.org/francek/32/10505_2.png) [@francek](https://discourse.vtk.org/u/francek)
#### Post date: [February 9, 2026, 9:58am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/5 "2026-02-09T09:58:52Z")

</div>

Hi ,

your code does not fix the error. This error is not about min/max macros.

std::min is a template and requies both its params to be of the same type. On x86

```auto
std::copy_n(parent_type::gptr(), (std::min)(available, count), str);

available is std::ptrdiff_t == int == 4 bytes (on x86, 8 bytes on x64)

count is std::streamsize == long long == 8 bytes

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 9, 2026, 10:12am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/6 "2026-02-09T10:12:19Z")

</div>

this should fix it: [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/12903](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12903)

---

<div class="post-metadata">

### Author: ![francek](https://discourse.vtk.org/user_avatar/discourse.vtk.org/francek/32/10505_2.png) [@francek](https://discourse.vtk.org/u/francek)
#### Post date: [February 9, 2026, 10:16am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/7 "2026-02-09T10:16:06Z")

</div>

error

`vtkResourceStream.cxx(80,18): error C1075: ‘(’: no matching token found`

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 9, 2026, 10:18am UTC](https://discourse.vtk.org/t/build-error-vtk-9-6-0-rc3-vtkresourcestream-cxx-line79-std-min-msvs-14-44-x86-debug/16280/8 "2026-02-09T10:18:12Z")

</div>

fixed.
