# VTK-9.1.0.rc2: vtkPoissonDiskSampler error: ld returned 1

**URL:** <https://discourse.vtk.org/t/vtk-9-1-0-rc2-vtkpoissondisksampler-error-ld-returned-1/7026>\
**Category:** Development\
**Created:** [November 1, 2021, 7:48am UTC](https://discourse.vtk.org/t/vtk-9-1-0-rc2-vtkpoissondisksampler-error-ld-returned-1/7026 "2021-11-01T07:48:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrwsl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@mrwsl](https://discourse.vtk.org/u/mrwsl)\
**Post date:** [November 1, 2021, 7:48am UTC](https://discourse.vtk.org/t/vtk-9-1-0-rc2-vtkpoissondisksampler-error-ld-returned-1/7026/1 "2021-11-01T07:48:33Z")

</div>

I built VTK myself on two systems (arch & ubuntu hirsute) and changed the [PolyDataPointSampler example](https://kitware.github.io/vtk-examples/site/Cxx/PolyData/PolyDataPointSampler/) to use the PoissonDiskSampler. On both systems I get the following error while compiling:

```auto
$ make
Scanning dependencies of target PolyDataPointSampler
[50%] Building CXX object CMakeFiles/PolyDataPointSampler.dir/PolyDataPointSampler.cxx.o
[100%] Linking CXX executable PolyDataPointSampler
/usr/bin/ld: CMakeFiles/PolyDataPointSampler.dir/PolyDataPointSampler.cxx.o: in function `vtkNew<vtkPoissonDiskSampler>::vtkNew()':
PolyDataPointSampler.cxx:(.text._ZN6vtkNewI21vtkPoissonDiskSamplerEC2Ev[_ZN6vtkNewI21vtkPoissonDiskSamplerEC5Ev]+0x11): undefined reference to `vtkPoissonDiskSampler::New()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/PolyDataPointSampler.dir/build.make:137: PolyDataPointSampler] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/PolyDataPointSampler.dir/all] Fehler 2
make: *** [Makefile:103: all] Fehler 2

```

---

<div class="post-metadata">

**Author:** ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)\
**Post date:** [November 1, 2021, 9:14am UTC](https://discourse.vtk.org/t/vtk-9-1-0-rc2-vtkpoissondisksampler-error-ld-returned-1/7026/2 "2021-11-01T09:14:03Z")

</div>

This filter is part of `FiltersPoints` module. Can you try adding this module in your `CMakeLists.txt`? It was not present in the example’s.

---

<div class="post-metadata">

**Author:** ![mrwsl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@mrwsl](https://discourse.vtk.org/u/mrwsl)\
**Post date:** [November 1, 2021, 9:33am UTC](https://discourse.vtk.org/t/vtk-9-1-0-rc2-vtkpoissondisksampler-error-ld-returned-1/7026/3 "2021-11-01T09:33:19Z")

</div>

Thanks for the hint - it is working now.

In another project I just added `find_package(VTK REQUIRED)` and got the same error. Can you tell me when I need to add modules to it? Thanks!

---

<div class="post-metadata">

**Author:** ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)\
**Post date:** [November 1, 2021, 10:04am UTC](https://discourse.vtk.org/t/vtk-9-1-0-rc2-vtkpoissondisksampler-error-ld-returned-1/7026/4 "2021-11-01T10:04:51Z")

</div>

If you use Python, then this may help in finding the needed modules [VTKModulesForCxx/](https://kitware.github.io/vtk-examples/site/Python/Utilities/VTKModulesForCxx/)

---

<div class="post-metadata">

**Author:** ![mrwsl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@mrwsl](https://discourse.vtk.org/u/mrwsl)\
**Post date:** [November 1, 2021, 11:17am UTC](https://discourse.vtk.org/t/vtk-9-1-0-rc2-vtkpoissondisksampler-error-ld-returned-1/7026/5 "2021-11-01T11:17:44Z")

</div>

I use c++ but it is still a good starting point.
