How to correctly add a reader plugin?

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
Please help me out, thank you very much!

Instead of this:

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

use:

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.

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

the setting has been updated here, could you please help me?

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

LXPNGReader.dll

I am working on windows :grinning:

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

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?

I use vs2017 to compile the plugin, and the build tree is shown below.
buildTree

and the dll is located in the below dir

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

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.