# Loading .so plugin to C++

**URL:** https://discourse.paraview.org/t/loading-so-plugin-to-c/1652
**Category:** Development
**Created:** [April 12, 2019, 3:34pm UTC](https://discourse.paraview.org/t/loading-so-plugin-to-c/1652 "2019-04-12T15:34:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sariug](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@sariug](https://discourse.paraview.org/u/sariug)
#### Post date: [April 12, 2019, 3:34pm UTC](https://discourse.paraview.org/t/loading-so-plugin-to-c/1652/1 "2019-04-12T15:34:38Z")

</div>

Hello,

I am new to VTK and hope asking question to correct place.

I am trying to implement c++ code and I want to use a custom paraview plugin an old collegue prepared. It is a .so file. I want to do is as it is done in plug in:

paraview.servermanager.LoadPlugin(‘libPythonTest.so’) [in my case its all c++ classes and more.]  
import helloworld  
helloworld.hello()

Is there an elegant and nice way to do so ?

Best regards,

---

<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: [April 12, 2019, 5:35pm UTC](https://discourse.paraview.org/t/loading-so-plugin-to-c/1652/2 "2019-04-12T17:35:16Z")

</div>

Not just any old library is a ParaView plugin. There’s some infrastructure around the code that needs to be there to tell ParaView about it.

Is your plugin code public? If it is just C++ code, [the AdiosPixieReader plugin](https://gitlab.kitware.com/paraview/paraview/tree/master/Plugins/AdiosReaderPixie/Pixie) should serve as a decent example for what is necessary.

---

<div class="post-metadata">

### Author: ![sariug](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@sariug](https://discourse.paraview.org/u/sariug)
#### Post date: [April 12, 2019, 8:43pm UTC](https://discourse.paraview.org/t/loading-so-plugin-to-c/1652/3 "2019-04-12T20:43:50Z")

</div>

No, no. This is a plugin library. On python I am able to use it with the code such as loadplugin in paraview.simple.

but I want to use full function of the same library, in c++. Loading it getting data and more.

I am not trying to turn some random c++ code into paraview library 🙂

---

<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: [April 15, 2019, 12:52pm UTC](https://discourse.paraview.org/t/loading-so-plugin-to-c/1652/4 "2019-04-15T12:52:05Z")

</div>

Ah, I see now. Let me restate to see if I understand:

- there’s an old ParaView plugin you have the binary for
- you can load it into ParaView
- you want to use the code in the plugin from new C++ code you want to write

Is that correct?

If so, you’ll need the headers for the classes in the library to be able to use them in new C++ code. Though I suppose you could reuse the ParaView plugin loading to get access to the QPluigin instances. Some raw Qt code would probably work as well. However, VTK classes tend not to be QObjects, so any of Qt’s metaprogramming facilities will likely be unavailable on them and you’ll still need headers to actually use them.
