# Vtk 9.3.1 compilation issue with Visual Studio 2022

**URL:** https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698
**Category:** Support
**Tags:** code
**Created:** [October 10, 2024, 2:32pm UTC](https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698 "2024-10-10T14:32:35Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![vishalkumar2222](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vishalkumar2222/32/3622_2.png) [@vishalkumar2222](https://discourse.vtk.org/u/vishalkumar2222)
#### Post date: [October 10, 2024, 2:32pm UTC](https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698/1 "2024-10-10T14:32:36Z")

</div>

I’m trying to compile VTK9.3.1 along with Qt 6.7.3 using Visual Studio 2022. I’m getting this error “vtkDepthPeelingPassIntermediateFS.h(6,1): error C1070: mismatched #if/#endif pair in file”  
Is there any solution of this ?

And, The interesting thing is, It is compiling when I use terminal but not when I use VisualStudio 2022 IDE.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [October 10, 2024, 7:46pm UTC](https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698/2 "2024-10-10T19:46:36Z")

</div>

Since vtkDepthPeelingPassIntermediateFS.h is generated during the build, the most likely reason for the error is that it wasn’t generated completely. Just delete this file and build again, it will be located somewhere in your build folder.

---

<div class="post-metadata">

### Author: ![vishalkumar2222](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vishalkumar2222/32/3622_2.png) [@vishalkumar2222](https://discourse.vtk.org/u/vishalkumar2222)
#### Post date: [October 11, 2024, 12:27pm UTC](https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698/3 "2024-10-11T12:27:25Z")

</div>

Thanks for the suggestion David but still it is doesn’t work.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [October 11, 2024, 12:39pm UTC](https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698/4 "2024-10-11T12:39:15Z")

</div>

Can you post the contents of the file? Just so that I can verify that it wasn’t incorrectly generated.

---

<div class="post-metadata">

### Author: ![vishalkumar2222](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vishalkumar2222/32/3622_2.png) [@vishalkumar2222](https://discourse.vtk.org/u/vishalkumar2222)
#### Post date: [October 14, 2024, 7:36am UTC](https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698/5 "2024-10-14T07:36:23Z")

</div>

// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen  
// SPDX-License-Identifier: BSD-3-Clause  
#ifndef vtkDepthPeelingPassIntermediateFS\_h  
#define vtkDepthPeelingPassIntermediateFS\_h

extern const char \*vtkDepthPeelingPassIntermediateFS;

#endif

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [October 16, 2024, 11:53am UTC](https://discourse.vtk.org/t/vtk-9-3-1-compilation-issue-with-visual-studio-2022/14698/6 "2024-10-16T11:53:58Z")

</div>

Yes, for VTK 9.3.1, those are the correct file contents. Your build is breaking on line six according to the error: vtkDepthPeelingPassIntermediateFS.h(6,1)

> [@](#):
>
> extern const char \*vtkDepthPeelingPassIntermediateFS;

I don’t know why this build error would happen, since this line has no `#if` or `#endif`. I don’t use the Visual Studio IDE, myself, only msbuild and ninja.

Apply the updates to your Visual Studio, perhaps there was a bug that Microsoft has fixed.
