# How to correctly add a reader plugin?

**URL:** https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789
**Category:** Development
**Created:** [May 7, 2019, 2:46pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789 "2019-05-07T14:46:57Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 7, 2019, 2:46pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/1 "2019-05-07T14:46:57Z")

</div>

Dear all,  
I’ve tried several days to build my own plugin and resulted in no success. I managed to compile ParaView from source and tried the sample plugin called mypngreader. After I load the plugin and try to open the .mypng file, the error shows up in the outwindow _“vtkSISourceProxy (000001DD6D517FF0): Failed to create ‘LXPNGReader’. This typically means that ParaView does not know about the request class to create an instance of if. Ensure that it has been correctly wrapped using the client-server wrappers and the wrapping has been initialized. Note class names are case-sensitive. Check for typos. Aborting for debugging purposes.”_ Really have no idea how to fix it.  
The plugin source can be found [here](https://github.com/caobaolu/MyPNGReader)  
Please help me out, thank you very much!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 7, 2019, 4:40pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/2 "2019-05-07T16:40:30Z")

</div>

Instead of this:

```auto
SERVER_MANAGER_XML "${CMAKE_CURRENT_SOURCE_DIR}/LXPNGReader/readers.xml"

```

use:

```auto
MODULES LXPNG
MODULE_FILES LXPNGReader/vtk.module

```

This will build the module and cause the plugin to load the client server wrapping code for its classes.

---

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 8, 2019, 1:44am UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/3 "2019-05-08T01:44:01Z")

</div>

Thank you very much for your reply~  
I followed your advice, but encountered the error bellow when I tried to load the plugin

> ERROR: In D:\Caobaolu\MyParaView\Source\paraview\ParaViewCore\ClientServerCore\Core\vtkPVPluginLoader.cxx, line 417  
> vtkPVPluginLoader (0000021FF60FA4C0): 找不到指定的模块。

> 找不到指定的模块: means _ **can’t find the module** _

---

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 8, 2019, 1:50am UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/4 "2019-05-08T01:50:47Z")

</div>

the setting has been updated [here](https://github.com/caobaolu/MyPNGReader), could you please help me?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 8, 2019, 12:59pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/5 "2019-05-08T12:59:08Z")

</div>

Hmm. It loads on Linux. Are you loading `LXPNGReader.dll` or `libLXPNG.dll`? The plugin is the first one.

---

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 8, 2019, 2:15pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/6 "2019-05-08T14:15:59Z")

</div>

LXPNGReader.dll

---

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 8, 2019, 2:19pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/7 "2019-05-08T14:19:17Z")

</div>

I am working on windows 😀

---

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 8, 2019, 3:51pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/8 "2019-05-08T15:51:35Z")

</div>

I tried again, it worked! Thank you very much!!!  
Need to run “install” to generate the dll

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 8, 2019, 6:59pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/9 "2019-05-08T18:59:42Z")

</div>

Hmm. Odd. What was the build tree and install tree layout (basically, where were the DLLs mentioned)? This may be fixed on `master`, so what commit are you using?

---

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 9, 2019, 1:34am UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/10 "2019-05-09T01:34:40Z")

</div>

I use vs2017 to compile the plugin, and the build tree is shown below.  
 ![buildTree](https://discourse.paraview.org/uploads/default/original/2X/5/5e56eb2a3e1bf52f10345ac7f4390ef63c810637.png)

and the dll is located in the below dir

> C:\Program Files (x86)\LXPNGReader\bin\paraview-5.6\plugins\LXPNGReader

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 9, 2019, 12:43pm UTC](https://discourse.paraview.org/t/how-to-correctly-add-a-reader-plugin/1789/11 "2019-05-09T12:43:44Z")

</div>

Sorry, should have been more specific. The `LXPNGReader.dll` or `libLXPNG.dll` files are somewhere in your build tree. Both should live under `bin\paraview-5.6\plugins\LXPNGReader`, but a bug that was fixed on May 1 (commit 59e5bd9e93076ed1fc23c01051e01c5463b6c861) caused the `libLXPNG.dll` to probably be directly under `bin` instead.
