<div dir="ltr">Hello, <div><br></div><div>The code using avahi_client_new is already in LibreOffice (I've pushed it during last summer). </div><div><br></div><div>I've tried to make a separate version of that same code broadcasting a _impressremote._tcp service alone. Even though the code compiles fine using dlopen, it does get an error code that I've never encountered before... In theory avahi.cxx will broadcast avahi service in a event loop thread, does dlopen change anything with respect to that? Also, internally avahi is based on dbus, not sure if that has anything to do with the issue. </div>

<div><br></div><div>For now, the problem is that the service can not get committed using avahi_entry_group_commit(). </div><div><br></div><div>I've attached the code if you have some time to check if I've used dlopen correctly. </div>

<div><br></div><div><br></div><div>The command that I've used to compile it is as follow</div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">g++ avahi.cxx -I/usr/include/dbus-1.0 \</div>
<div style="font-family:arial,sans-serif;font-size:13px">
           -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include \</div><div style="font-family:arial,sans-serif;font-size:13px">           -I/usr/include/glib-2.0 \</div><div style="font-family:arial,sans-serif;font-size:13px">           -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ \</div>

<div style="font-family:arial,sans-serif;font-size:13px">           -ldbus-1 \</div><div style="font-family:arial,sans-serif;font-size:13px">           -ldbus-glib-1 \</div><div style="font-family:arial,sans-serif;font-size:13px">

           -lavahi-glib -lavahi-common -lavahi-core -lavahi-client -ldl</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div>Thanks!</div>

<div>Siqi</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 29, 2014 at 12:09 PM, Caolán McNamara <span dir="ltr"><<a href="mailto:caolanm@redhat.com" target="_blank">caolanm@redhat.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, 2014-01-24 at 22:51 +0100, Siqi Liu wrote:<br>
><br>
> For example, I can dlsym this function and get the void * to it, but<br>
> how can I use it if I don't have access to the struct AvahiClient<br>
> (declaired in the shared object)?<br>
> AvahiClient* avahi_client_new<br>
> (<br>
> const AvahiPoll *<br>
> poll_api,<br>
><br>
><br>
> AvahiClientFlags<br>
> flags,<br>
><br>
><br>
> AvahiClientCallback<br>
> callback,<br>
><br>
><br>
> void *<br>
> userdata,<br>
><br>
><br>
> int *<br>
> error<br>
><br>
><br>
<br>
</div>Well, it depends on usage if you can get away with including the<br>
headers. e.g. if you just need to manipulate the returned thing through<br>
a pointer to it and dlsymed functions then you can just shove e.g.<br>
typedef struct _AvahiClient AvahiClient;<br>
into your .cxx and that'll work.<br>
<br>
e.g. see vcl/unx/gtk/window/xid_fullscreen_on_all_monitors.c for an<br>
example<br>
<br>
Is the code using avahi_client_new that you want to make runtime<br>
optional already in LibreOffice or is it new code you want to add ?<br>
<span class="HOEnZb"><font color="#888888"><br>
C.<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>--------</div><div><br></div><div>Cordialement,</div>Siqi LIU<div><br><div>Étudiant Ingénieur, 1ère année</div><div>École Supérieur d'Électricité (Supélec)</div>

</div><div><br></div></div>
</div>