Help with pluginss - compiling the example plugin

168 views
Skip to first unread message

richard...@neuro.ufrn.br

unread,
Jun 14, 2016, 3:52:33 PM6/14/16
to Open Ephys
Hi All,

I am trying to compile the example plugin to understand plugin architecture and without modifying much of the code I can compile fine but the shared object fails to load when i start open ephys:

p:177: Failed to load plugin DLL: /home/richardson/OpenEphys/plugin-GUI/Builds/Linux/build/plugins/NotchR.so: undefined symbol: _ZTV13ExampleEditor
 DLL Load FAILED

is there anything I need to change in the example plugin to compile it? Many thanks!!!

Ananya B

unread,
Jun 28, 2016, 2:45:02 PM6/28/16
to Open Ephys
Hi Richard,

I've just got my hands dirty with the plugin GUI, so I might be wrong.
This can happen when you've declared a method or a function in a header file, but forgot to implement it in the corresponding source file. I made that mistake, and just as your experience, the plugin compiled but DLL did not load. The undefined symbol is nothing but the symbol (function / method) which is declared but not defined.
The word _ZTV13ExampleEditor contains almost the whole symbol name. Looks like you missed defining the ExampleEditor constructor, or defined it with wrong arguments?
Look for a something which is not defined in any of your (example) plugin files but is mentioned in the headers.

Hope this helps!
Ananya

Ananya B

unread,
Jul 6, 2016, 11:40:08 AM7/6/16
to Open Ephys
Hi again Richard!

I encountered another instance of this linker error and I have found out how to debug such situations.
First of all, you must know that the gibberish "symbol" is actually a mangled name. This mangling is done by the c++ compiler to support polymorphism. The compiler converts the names of all functions, variables and definitions into unique mangled identifiers (this is how it and the linker can differentiate functions with same name, different arguments, etc).
Assuming you are on a linux system,you can use c++filt do de-mangle the name. On the other hand nm will list all symbols specified in an object file (and also lists whether the symbol is defined in this object file or elsewhere).
$$ c++filt _ZTV13ExampleEditor
will return vtable for ExampleEditor

To use nm, on the CLI just give the object file name as an argument like this,
$$ nm ExampleEditor.o
That means the compiler was unable to fill the virtual table for ExampleEditor. If you invoke nm <path-to>/ExampleEditor.o, you will see that the constructor is well defined (sorry for misleading you in the last reply)!
You can rectify this problem by taking guidance from these SO posts:
Undefined reference to vtable
undefined reference to vtable - virtual member, classes generated by gsoap


Cheers!
Ananya

sebastien delcasso

unread,
Nov 12, 2016, 3:07:11 PM11/12/16
to Open Ephys

I tried this one and everything works fine if I don't use an Editor (if I dont't have ExampleEditor.cpp and ExampleEditor.h, in the folder when I compile the plugin)

 

I this two files are present I got an error not during compilation but during run

 

Loading Plugin: Threshold2TTL... ../../Source/Processors/PluginManager/PluginManager.cpp:177: Failed to load plugin DLL: /home/delcasso/plugin-GUI/Builds/Linux/build/plugins/Threshold2TTL.so: undefined symbol: _ZTV19Threshold2TTLEditor
DLL Load FAILED


I don't know what to do, and Ananya B, I don't understand your message with c++filt, I tried to look at the vtable but I don't understand it.

Please help :) 
Reply all
Reply to author
Forward
0 new messages