<div dir="ltr"><div>Ok, this looks like a bug in the way the plugin calls are implemented.<br><br></div>In pluginA_ext.h, the symbol used to point to the api call is defined as:<br>static api_call_t __api_call = NULL;                                                    <br><div><div><div><br></div><div>Because the symbol is static, it will be re-defined within *every* module that includes pluginA_ext.h.<br></div><div>However, in the example I described only the symbol in pluginB.cpp will be initialized.<br></div><div>The symbol in pluginB_module.cpp will remain NULL.<br><br></div><div>Could someone propose some clean way around this limitation?<br><br></div><div>I quickly checked that if I change the definition in the _ext header to an &quot;extern&quot; declaration and move the definition in pluginB.cpp the calls succeed. But this is just a quick&amp;dirty hack to verify the problem, as it involves manually editing the _ext file.<br><br></div><div>Thanks,<br></div><div>Manolis<br></div><div><br></div><div><br></div><div><br><br><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-19 15:56 GMT-07:00 Manolis Stamatogiannakis <span dir="ltr">&lt;<a href="mailto:mstamat@gmail.com" target="_blank">mstamat@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>I&#39;m having problems with using the plugin api to make calls across plugins. Is there an implicit assumption that plugins should consist of a single file?<br><br></div>Here are the steps I make:<br></div>(1) define the function in pluginA_int_fns.h<br></div>(2) include this header in pluginA_int.h<br>(3) implement the function in pluginA.cpp<br></div> <br></div>(4) include generated pluginA_ext.h from pluginB.cpp<br></div>(5) call init_pluginA_api() without problems<br></div>(6) include generated pluginA_ext.h from pluginB_module.cpp<br></div>(7) make the API call from within pluginB_module.cpp<br><br></div>Everything compiles fine, but at runtime I hit the assertion error in the function definition in pluginA_ext.h.<br></div>I added some printfs and __api_call is not NULL just after init_pluginA_api() in pluginB.cpp. However, it is NULL inside pluginB_module.cpp.<br><br></div>Any ideas how could that happen? Am I missing something in the picture?<br><br></div>Thanks,<br></div>Manolis<br><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br></div>