# Build a plugin from examples

**URL:** https://discourse.paraview.org/t/build-a-plugin-from-examples/1537
**Category:** ParaView Support
**Created:** [March 27, 2019, 10:21am UTC](https://discourse.paraview.org/t/build-a-plugin-from-examples/1537 "2019-03-27T10:21:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![e-kolosov](https://discourse.paraview.org/user_avatar/discourse.paraview.org/e-kolosov/32/2375_2.png) [@e-kolosov](https://discourse.paraview.org/u/e-kolosov)
#### Post date: [March 27, 2019, 10:21am UTC](https://discourse.paraview.org/t/build-a-plugin-from-examples/1537/1 "2019-03-27T10:21:24Z")

</div>

Hello!  
I was trying to build “MyPNGReader” plugin from ParaView examples but as a result I will have the static library “MyPNGReader.a”.  
My actions:

- copy paraview/Examples/Plugins/MyPNGReader to external directory ~/projects/paraview/cpp-plugins/MyPNGReader

- create directory ~/projects/paraview/cpp-plugins/build-MyPNGReader

- cd ~/projects/paraview/cpp-plugins/build-MyPNGReader

- cmake …/MyPNGReader/ \>\> cmake.log  
[cmake.log](https://discourse.paraview.org/uploads/default/original/2X/9/967c0dcdd6b0c79170c127123f296d4ec72a4267.log) (1.9 KB)

- cmake --build . \>\> build.log  
[build.log](https://discourse.paraview.org/uploads/default/original/2X/b/b9772f93435371936192718ce7d1627719bf5a29.log) (735 Bytes)

How I can build a shared library (plugin)? Maybe I should set some variables to cmake?  
Thanks.

---

<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 27, 2019, 10:34am UTC](https://discourse.paraview.org/t/build-a-plugin-from-examples/1537/2 "2019-03-27T10:34:43Z")

</div>

You have to set the cmake var BUILD\_SHARED\_LIBS to ON.

@ben.boeckel

---

<div class="post-metadata">

### Author: ![e-kolosov](https://discourse.paraview.org/user_avatar/discourse.paraview.org/e-kolosov/32/2375_2.png) [@e-kolosov](https://discourse.paraview.org/u/e-kolosov)
#### Post date: [March 27, 2019, 11:30am UTC](https://discourse.paraview.org/t/build-a-plugin-from-examples/1537/3 "2019-03-27T11:30:27Z")

</div>

Thanks, Mathieu!
