# LNK2019	unresolved external symbol... I encountered problems when building vtk into static libs

**URL:** https://discourse.vtk.org/t/lnk2019-unresolved-external-symbol-i-encountered-problems-when-building-vtk-into-static-libs/14646
**Category:** Support
**Created:** [October 1, 2024, 6:27pm UTC](https://discourse.vtk.org/t/lnk2019-unresolved-external-symbol-i-encountered-problems-when-building-vtk-into-static-libs/14646 "2024-10-01T18:27:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Etzka](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/f4b2a3/32.png) [@Etzka](https://discourse.vtk.org/u/Etzka)
#### Post date: [October 1, 2024, 6:27pm UTC](https://discourse.vtk.org/t/lnk2019-unresolved-external-symbol-i-encountered-problems-when-building-vtk-into-static-libs/14646/1 "2024-10-01T18:27:47Z")

</div>

I encountered errors!  
after generating VTK.sln in build tree with cmake, I compiled my build tree(built from VTK source) with VS2022, then the errors show:

Error LNK2019 unresolved external symbol “public: bool \_\_cdecl vtk::detail::smp::vtkSMPToolsImpl\<1\>::IsParallelScope(void)” (?IsParallelScope@?$vtkSMPToolsImpl@$00@smp@detail@vtk@@QEAA\_NXZ) referenced in function “public: bool \_\_cdecl vtk::detail::smp::vtkSMPToolsAPI::IsParallelScope(void)” (?IsParallelScope@vtkSMPToolsAPI@smp@detail@vtk@@QEAA\_NXZ) vtkProbeOpenGLVersion D:\VTK\build-9.3.1\Rendering\OpenGL2\vtkCommonCore-9.3.lib(vtkSMPToolsAPI.obj) 1  
Error LNK1120 1 unresolved externals vtkProbeOpenGLVersion D:\VTK\build-9.3.1\bin\Release\vtkProbeOpenGLVersion-9.3.exe 1

more details:  
in cmake, the generator is VS2022, and I unchecked the BUILD\_SHARED\_LIBS option in cmake-gui to obtain static libs.  
in VS2022, I set the configurations to be “Release”,“x64”. the c++ standard is C++14.  
the vtk version is 9.3.1.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [October 1, 2024, 6:30pm UTC](https://discourse.vtk.org/t/lnk2019-unresolved-external-symbol-i-encountered-problems-when-building-vtk-into-static-libs/14646/2 "2024-10-01T18:30:06Z")

</div>

this linker error is fixed in master branch - [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/11365](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11365). It will be available in 9.4 (november)

---

<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 1, 2024, 11:34pm UTC](https://discourse.vtk.org/t/lnk2019-unresolved-external-symbol-i-encountered-problems-when-building-vtk-into-static-libs/14646/3 "2024-10-01T23:34:46Z")

</div>

There’s also a follow-up fix for those same source files, but for a duplicate symbol rather than a missing symbol:  
[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/11530/diffs](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11530/diffs)  
The follow-up fix is only required for people who use TBB.
