# Linking issues compiling example plugin with paraview-plugin-builder

**URL:** https://discourse.paraview.org/t/linking-issues-compiling-example-plugin-with-paraview-plugin-builder/3791
**Category:** ParaView Support
**Created:** [March 11, 2020, 3:57pm UTC](https://discourse.paraview.org/t/linking-issues-compiling-example-plugin-with-paraview-plugin-builder/3791 "2020-03-11T15:57:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ChristosT](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christost/32/3285_2.png) [@ChristosT](https://discourse.paraview.org/u/ChristosT)
#### Post date: [March 11, 2020, 3:57pm UTC](https://discourse.paraview.org/t/linking-issues-compiling-example-plugin-with-paraview-plugin-builder/3791/1 "2020-03-11T15:57:18Z")

</div>

Hello,

I am trying to build and load the ElevationFilter from the Examples directory. Build completes successfully but loading the plugin from the GUI returns the following error:

```
ERROR: In /home/buildslave/dashboards/buildbot/paraview-pvbinsdash-linux-shared-release_superbuild/build/superbuild/paraview/src/Remoting/Core/vtkPVPluginLoader.cxx, line 519

vtkPVPluginLoader (0x62fb1e0): libElevationFilters.so: cannot open shared object file: No such file or directory

```

Steps followed:

1. Use [paraview-plugin-builder](https://gitlab.kitware.com/paraview/paraview-plugin-builder) to build a docker image for paraview 5.8.0
2. copy `Examples/Plugins/ElevationFilter` directory from master branch
3. run `./run_build_plugin.sh -d ElevationFilter v5.8.0`
4. the above command completes and generates `ElevationFilter.so libElevationFilters.so`
5. Open Paraview 5.8.0 (downloaded from [https://www.paraview.org/download/](https://www.paraview.org/download/) )
6. Attempt to load the plugin (`ElevationFilter.so`) through the GUI.

Note:  
`ldd ElevationFilter.so` returns:

```auto
$ ldd ElevationFilter.so 
...
       libElevationFilters.so (0x00007f6e818de000)
... 

```

System:  
Ubuntu 16.04.06, 4.4.0-176-generic

Thank you.

---

<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: [March 12, 2020, 2:26am UTC](https://discourse.paraview.org/t/linking-issues-compiling-example-plugin-with-paraview-plugin-builder/3791/2 "2020-03-12T02:26:10Z")

</div>

this example produce two .so files that you have to recover and place together in a folder.

`ElevationFilter.so libElevationFilters.so`

It may be nice to improve paraview-plugin-builder to make that clearer.

You can modify this example quite easily to makes it link statically with the second lib so this is not needed.

---

<div class="post-metadata">

### Author: ![ChristosT](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christost/32/3285_2.png) [@ChristosT](https://discourse.paraview.org/u/ChristosT)
#### Post date: [March 12, 2020, 6:44pm UTC](https://discourse.paraview.org/t/linking-issues-compiling-example-plugin-with-paraview-plugin-builder/3791/3 "2020-03-12T18:44:02Z")

</div>

Thank you for the quick reply.  
When I tried to load `ElevationFilter.so` both of the `.so` files were in the same directory. I tried also to put them in `./bin/plugins` and `./lib/plugins/` but had no luck.

It looks however that adding

```auto
set(CMAKE_INSTALL_RPATH $ORIGIN)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

```

in the top level `CMakeLists.txt` solves the issue (at least on my platform).

---

<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: [March 13, 2020, 2:33am UTC](https://discourse.paraview.org/t/linking-issues-compiling-example-plugin-with-paraview-plugin-builder/3791/4 "2020-03-13T02:33:07Z")

</div>

Looks a platform specific issue then. Thanks for sharing.

Tbh I tend to build my internal module lib statically to avoid needing to move around multiple files.

Done with :

```
vtk_module_add_module(module
  FORCE_STATIC
  ...
```
