# Use external lib in vkt filter

**URL:** https://discourse.paraview.org/t/use-external-lib-in-vkt-filter/3010
**Category:** Development
**Created:** [November 20, 2019, 11:18am UTC](https://discourse.paraview.org/t/use-external-lib-in-vkt-filter/3010 "2019-11-20T11:18:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SimonFuet](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@SimonFuet](https://discourse.paraview.org/u/SimonFuet)
#### Post date: [November 20, 2019, 11:18am UTC](https://discourse.paraview.org/t/use-external-lib-in-vkt-filter/3010/1 "2019-11-20T11:18:09Z")

</div>

Hi all,  
I’va created a C++ ParaView plugin containing a vtk filter. This filter uses (includes) a library (as a git submodule).

In the CMakeLists.txt, I’ve added the directory of the library (with the _add\_subdirectory_ command, the library .so is generated) and the include directories so that the filter and plugin compile.

However the filter library (myvtkFilter.so) is not linked to to that library. I have an undefined symbol when I try to execute the filter in ParaView (the plugin is loaded without error), and the library does not appear in the dependencies when I use the ldd command.

I tried to add a _target\_link\_library_ in various places, but it never seems to work. I have the following messages:  
The keyword signature for target\_link\_libraries has already been used with  
the target “XXXFilter”. All uses of target\_link\_libraries with a target  
must be either all-keyword or all-plain.  
or  
Failed to find the required module XXX (name of my library)

Any idea about what I need to do to make it work? Or any example of vtk filters using libraries?

Thanks

Simon

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 20, 2019, 11:56am UTC](https://discourse.paraview.org/t/use-external-lib-in-vkt-filter/3010/2 "2019-11-20T11:56:25Z")

</div>

you can find an example in `Plugins/GmshReader`

---

<div class="post-metadata">

### Author: ![SimonFuet](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@SimonFuet](https://discourse.paraview.org/u/SimonFuet)
#### Post date: [November 20, 2019, 12:24pm UTC](https://discourse.paraview.org/t/use-external-lib-in-vkt-filter/3010/3 "2019-11-20T12:24:48Z")

</div>

Thank you so much! I was just missing the vtk\_module\_link
