# VTK Error : "Vector subscript out of range" while setting Input connection in (happen only in debug)

**URL:** https://discourse.vtk.org/t/vtk-error-vector-subscript-out-of-range-while-setting-input-connection-in-happen-only-in-debug/7552
**Category:** Support
**Created:** [January 4, 2022, 6:48am UTC](https://discourse.vtk.org/t/vtk-error-vector-subscript-out-of-range-while-setting-input-connection-in-happen-only-in-debug/7552 "2022-01-04T06:48:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![osezer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/osezer/32/4496_2.png) [@osezer](https://discourse.vtk.org/u/osezer)
#### Post date: [January 4, 2022, 6:48am UTC](https://discourse.vtk.org/t/vtk-error-vector-subscript-out-of-range-while-setting-input-connection-in-happen-only-in-debug/7552/1 "2022-01-04T06:48:04Z")

</div>

Hello, I compiled VTK 9 and OCCT 7.6.0 with VTK 9.1.0 but I’m getting this error only in debug mode in release mode it is fine.

Exact line : //Mapper-\>SetInputConnection(OCCSource-\>GetOutputPort());

Exact same issue (asked by different person) : [c++ - VTK is giving the error "Vector subscript out of range" while setting Input connection in debug - Stack Overflow](https://stackoverflow.com/questions/68607976/vtk-is-giving-the-error-vector-subscript-out-of-range-while-setting-input-conn)

PS : I checked comments in stackoverflow and follow ([0032331: VIS - Exception when trying to display some surfaces using iVtk with VTK 9 - MantisBT](https://tracker.dev.opencascade.org/view.php?id=32331)) here too but since I’m using 7.6.0 it is already included but still giving me error.

---

<div class="post-metadata">

### Author: ![osezer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/osezer/32/4496_2.png) [@osezer](https://discourse.vtk.org/u/osezer)
#### Post date: [January 6, 2022, 2:20pm UTC](https://discourse.vtk.org/t/vtk-error-vector-subscript-out-of-range-while-setting-input-connection-in-happen-only-in-debug/7552/2 "2022-01-06T14:20:44Z")

</div>

I solved the problem by adding occt runtime deps (freetype). After runtime deps solved port also return properly and debug symbols works properly as well.

---

<div class="post-metadata">

### Author: ![beevasya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/beevasya/32/4650_2.png) [@beevasya](https://discourse.vtk.org/u/beevasya)
#### Post date: [February 4, 2022, 7:39am UTC](https://discourse.vtk.org/t/vtk-error-vector-subscript-out-of-range-while-setting-input-connection-in-happen-only-in-debug/7552/3 "2022-02-04T07:39:39Z")

</div>

Could you tell how you did it

---

<div class="post-metadata">

### Author: ![osezer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/osezer/32/4496_2.png) [@osezer](https://discourse.vtk.org/u/osezer)
#### Post date: [February 4, 2022, 8:58am UTC](https://discourse.vtk.org/t/vtk-error-vector-subscript-out-of-range-while-setting-input-connection-in-happen-only-in-debug/7552/4 "2022-02-04T08:58:24Z")

</div>

I added dll to into $PATH in order to fix. (or you can copy dlls next to executable as well)
