# vtk Custom Filter Clarification:

**URL:** https://discourse.vtk.org/t/vtk-custom-filter-clarification/11605
**Category:** Development
**Tags:** code
**Created:** [June 2, 2023, 11:55pm UTC](https://discourse.vtk.org/t/vtk-custom-filter-clarification/11605 "2023-06-02T23:55:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ramen-newdals](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ramen-newdals/32/7173_2.png) [@ramen-newdals](https://discourse.vtk.org/u/ramen-newdals)
#### Post date: [June 2, 2023, 11:55pm UTC](https://discourse.vtk.org/t/vtk-custom-filter-clarification/11605/1 "2023-06-02T23:55:29Z")

</div>

Hello All,

System: VTK-9.2, using gcc-12

I am working on developing some custom filters for vtk, to get started I am using the vtk examples as a guide this example specifically ([https://examples.vtk.org/site/Cxx/Developers/PolyDataFilter/](https://examples.vtk.org/site/Cxx/Developers/PolyDataFilter/)).When I try and compile the example I get the following error:

```auto
PolyDataAlgorithmReader.cxx:(.text+0x59): undefined reference to `vtkPolyDataAlgorithm::GetOutput()'

```

I suspect that I am just missing a vtk module in the find\_package() command in the CMakelists.txt file, but I cant find any guidance in the documentation for what module needs to be loaded (Tried PolyDataAlgorithim and no luck).

Any help is greatly appreciated in resolving this issue!

---

<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: [June 3, 2023, 8:43am UTC](https://discourse.vtk.org/t/vtk-custom-filter-clarification/11605/2 "2023-06-03T08:43:18Z")

</div>

That’s true, there are missing modules. The automated cmake generator is only picking up the contents of `PolyDataFilter.cxx`.  
You have two opitions:

1. (The best) Run [VTKModulesForCxx](https://examples.vtk.org/site/Python/Utilities/VTKModulesForCxx/). However you need Python for this.
2. Look through other examples where the VTK classes are used and add in the missing packages. This link could be really useful here: [CxxVTKClassesUsed](https://examples.vtk.org/site/Cxx/Coverage/CxxVTKClassesUsed/)

---

<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: [June 3, 2023, 11:41pm UTC](https://discourse.vtk.org/t/vtk-custom-filter-clarification/11605/3 "2023-06-03T23:41:31Z")

</div>

I have updated the web pages with the modules that you will need, see the `find_package` statement in the comments on the web page.

---

<div class="post-metadata">

### Author: ![ramen-newdals](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ramen-newdals/32/7173_2.png) [@ramen-newdals](https://discourse.vtk.org/u/ramen-newdals)
#### Post date: [June 4, 2023, 12:53am UTC](https://discourse.vtk.org/t/vtk-custom-filter-clarification/11605/4 "2023-06-04T00:53:59Z")

</div>

Thank you, sorry for the late reply was on a flight. VTKModulesForCxx worked like a charm and a great utility to learn how to develop with VTK so I marked that as the answer!
