[LAD] suil error: Unable to open UI library

Phil CM philcm at gnu.org
Wed Oct 15 20:26:44 UTC 2014

On 15/10/14 20:17, Paul Davis wrote:
> On Wed, Oct 15, 2014 at 2:24 PM, Phil CM <philcm at gnu.org 
> <mailto:philcm at gnu.org>> wrote:
>     Hello LADs
>     I'm trying to make a GUI for a LV2 synth based on so-404. In fact,
>     I'm trying to learn C / C++.
>     I got everything to build OK, but I'm stuck on a hard to read
>     execution error ; when I load the plugin in jalv, it loads it OK,
>     but fails to load the UI and says :
>     suil error: Unable to open UI library
>     /usr/local/lib/lv2/kis.lv2/kis_gui.so
>     (/usr/local/lib/lv2/kis.lv2/kis_gui.so: undefined symbol:
>     _Z17instantiateSO_404PK15_LV2_DescriptordPKcPKPK12_LV2_Feature)
> % echo _Z17instantiateSO_404PK15_LV2_DescriptordPKcPKPK12_LV2_Feature 
> | c++filt
> instantiateSO_404(_LV2_Descriptor const*, double, char const*, 
> _LV2_Feature const* const*)
> %
> your plugin is missing a symbol (instantiateSO_404(...)), apparently.
The problem seems to be different implementations of instantiate().

In Harry's example 
<https://github.com/harryhaaren/lv2/tree/master/plugins/eg-sinsynth.lv2>, the 
methods that (AFAIU) LV2 expects :

  * instantiate()
  * connect_port()
  * activate()
  * run()
  * deactivate()
  * cleanup()
  * extension_data()

Are declared explicitely, using static.

Like this :

static LV2_Handle
instantiate(const LV2_Descriptor*     descriptor,
             double                    rate,
             const char*               bundle_path,
             const LV2_Feature* const* features)
   SinSynth* self = (SinSynth*)malloc(sizeof(SinSynth));

   // store the sample rate in "self" so we can retrieve it in run()
   self->sample_rate = rate;

   // initialize the phase so we start at the beginning of the wave
   self->phase = 0.f;

   return self;

connect_port(LV2_Handle instance,
              uint32_t   port,
              void*      data)
   SinSynth* self=(SinSynth*)instance;

   switch (port) {
   case AMP_FREQ:
     self->freq = (float*)data;
   case AMP_MIDI:
     self->MidiIn = data;
   case AMP_OUTPUT:
     self->output = (float*)data;

static void
activate(LV2_Handle instance)


Whereas in so-404, they are somehow "surcharged", like this :

void runSO_404( LV2_Handle arg, uint32_t nframes );
LV2_Handle instantiateSO_404(const LV2_Descriptor *descriptor,double 
s_rate, const char *path,const LV2_Feature * const* features);
void cleanupSO_404(LV2_Handle instance);
void connectPortSO_404(LV2_Handle instance, uint32_t port, void 

static LV2_Descriptor kis_Descriptor= {

So apparently instead of being declared thusly:

instantiateSO_404(const LV2_Descriptor* descriptor,
                   double s_rate,
                   const char *path,
                   const LV2_Feature * const* features)

Either my instantiate method return value should be static, or my 
"mandatory" methods should be declared explicitely. I tried to adapt 
them, but failed so far.
Please excuse my sub-newbie mistakes.


> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-audio-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20141015/1bee67cb/attachment.html>

More information about the Linux-audio-dev mailing list