<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 15/10/14 20:17, Paul Davis wrote:<br>
</div>
<blockquote
cite="mid:CAFa_cKn0se_VtKyEX6h4B9URvgahKf3ExvhWu5-nW8Do56+1og@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Oct 15, 2014 at 2:24 PM, Phil
CM <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:philcm@gnu.org" target="_blank">philcm@gnu.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Hello LADs<br>
<br>
I'm trying to make a GUI for a LV2 synth based on so-404.
In fact, I'm trying to learn C / C++.<br>
<br>
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 :<br>
<br>
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)<br>
</blockquote>
<div><br>
<br>
% echo
_Z17instantiateSO_404PK15_LV2_DescriptordPKcPKPK12_LV2_Feature
| c++filt <br>
</div>
</div>
</div>
</div>
</blockquote>
Wow, now that is a nice tool, thanks (a <i>lot</i>) for the tip!<br>
<blockquote
cite="mid:CAFa_cKn0se_VtKyEX6h4B9URvgahKf3ExvhWu5-nW8Do56+1og@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>instantiateSO_404(_LV2_Descriptor const*, double, char
const*, _LV2_Feature const* const*)<br>
% <br>
<br>
</div>
<div>your plugin is missing a symbol
(instantiateSO_404(...)), apparently.<br>
</div>
</div>
</div>
</div>
</blockquote>
In my kis.h file, required in my kis.c file, I have this<br>
<br>
<tt>LV2_Handle instantiateSO_404(const LV2_Descriptor
*descriptor,double s_rate, const char *path,const LV2_Feature *
const* features);</tt><tt><br>
</tt><tt><br>
</tt><tt>static LV2_Descriptor kis_Descriptor= {</tt><tt><br>
</tt><tt> .URI=<a class="moz-txt-link-rfc2396E" href="https://bitbucket.org/xaccrocheur/kis">"https://bitbucket.org/xaccrocheur/kis"</a>,</tt><tt><br>
</tt><tt> <font color="#cc0000">.instantiate=instantiateSO_404,</font></tt><tt><br>
</tt><tt> .connect_port=connectPortSO_404,</tt><tt><br>
</tt><tt> .activate=NULL,</tt><tt><br>
</tt><tt> .run=runSO_404,</tt><tt><br>
</tt><tt> .deactivate=NULL,</tt><tt><br>
</tt><tt> .cleanup=cleanupSO_404,</tt><tt><br>
</tt><tt> .extension_data=NULL,</tt><tt><br>
</tt><tt>};</tt><br>
<br>
And in the kis.c file is a <br>
<br>
<tt>LV2_Handle <font color="#cc0000">instantiateSO_404</font>(const
LV2_Descriptor* descriptor,double s_rate, const char *path,const
LV2_Feature * const* features) {</tt><tt><br>
</tt><tt> so_404* so=malloc(sizeof(so_404));</tt><tt><br>
</tt><tt> LV2_URI_Map_Feature *map_feature;</tt><tt><br>
</tt><tt> const LV2_Feature * const * ft;</tt><tt><br>
</tt><tt> for (ft = features; *ft; ft++) {</tt><tt><br>
</tt><tt> if (!strcmp((*ft)->URI,
<a class="moz-txt-link-rfc2396E" href="http://lv2plug.in/ns/ext/uri-map">"http://lv2plug.in/ns/ext/uri-map"</a>)) {</tt><tt><br>
</tt><tt> map_feature = (*ft)->data;</tt><tt><br>
</tt><tt> so->midi_event_id = map_feature->uri_to_id(</tt><tt><br>
</tt><tt>
map_feature->callback_data,</tt><tt><br>
</tt><tt>
<a class="moz-txt-link-rfc2396E" href="http://lv2plug.in/ns/ext/event">"http://lv2plug.in/ns/ext/event"</a>,</tt><tt><br>
</tt><tt>
<a class="moz-txt-link-rfc2396E" href="http://lv2plug.in/ns/ext/midi#MidiEvent">"http://lv2plug.in/ns/ext/midi#MidiEvent"</a>);</tt><tt><br>
</tt><tt> } else if (!strcmp((*ft)->URI,
<a class="moz-txt-link-rfc2396E" href="http://lv2plug.in/ns/ext/event">"http://lv2plug.in/ns/ext/event"</a>)) {</tt><tt><br>
</tt><tt> so->event_ref = (*ft)->data;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> puts( "SO-404 v.1.2 by 50m30n3 2009-2011" );</tt><tt><br>
</tt><tt><br>
</tt><tt> so->phase = 0.0;</tt><tt><br>
</tt><tt> so->freq = 440.0;</tt><tt><br>
</tt><tt> so->tfreq = 440.0;</tt><tt><br>
</tt><tt> so->amp = 0.0;</tt><tt><br>
</tt><tt> so->env=0.0;</tt><tt><br>
</tt><tt> so->vel=0;</tt><tt><br>
</tt><tt> so->fcutoff = 0.0;</tt><tt><br>
</tt><tt> so->fspeed = 0.0;</tt><tt><br>
</tt><tt> so->fpos = 0.0;</tt><tt><br>
</tt><tt> so->lastsample = 0.0;</tt><tt><br>
</tt><tt> so->noteson = 0;</tt><tt><br>
</tt><tt> so->cdelay = s_rate/100;</tt><tt><br>
</tt><tt> so->samplerate=s_rate;</tt><tt><br>
</tt><tt><br>
</tt><tt> so->release = 100;</tt><tt><br>
</tt><tt> so->cutoff = 50;</tt><tt><br>
</tt><tt> so->envmod = 80;</tt><tt><br>
</tt><tt> so->resonance = 100;</tt><tt><br>
</tt><tt> so->volume = 100;</tt><tt><br>
</tt><tt> so->portamento = 64;</tt><tt><br>
</tt><tt><br>
</tt><tt> return so;</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><br>
And in the gui file, indeed :<br>
<br>
<tt>static LV2UI_Descriptor <font color="#cc0000">descriptors[]</font>
= {</tt><tt><br>
</tt><tt> {KIS_UI_URI, <font color="#cc0000">instantiate</font>,
cleanup, port_event, extension_data}</tt><tt><br>
</tt><tt>};</tt><tt><br>
</tt><tt><br>
</tt><tt>const LV2UI_Descriptor * lv2ui_descriptor(uint32_t index) {</tt><tt><br>
</tt><tt> printf("lv2ui_descriptor(%u) called\n", (unsigned
int)index);</tt><tt><br>
</tt><tt> if (index >= sizeof(descriptors) /
sizeof(descriptors[0])) {</tt><tt><br>
</tt><tt> return NULL;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> <font color="#cc0000">return descriptors</font> +
index;</tt><tt><br>
</tt><tt> // return NULL;</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><br>
How does that work? <br>
<ul>
<li>Is the UI always supposed to return the instantiate handle?</li>
<li>How is it supposed to return it?</li>
</ul>
<br>
Thanks a lot,<br>
<br>
--Phil<br>
<br>
<blockquote
cite="mid:CAFa_cKn0se_VtKyEX6h4B9URvgahKf3ExvhWu5-nW8Do56+1og@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Linux-audio-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Linux-audio-dev@lists.linuxaudio.org">Linux-audio-dev@lists.linuxaudio.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxaudio.org/listinfo/linux-audio-dev">http://lists.linuxaudio.org/listinfo/linux-audio-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>