<br><br><div class="gmail_quote">2009/6/11 evanescent <span dir="ltr">&lt;<a href="mailto:coolnuwan@gmail.com">coolnuwan@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I got this compilation error while I try to write avahi client to publish service.<br>I was trying to write the program from the scratch. <br><br>Here is the program. <br><br>[code]<br><br>#include &lt;stdio.h&gt;<br>

<br>#include &lt;avahi-client/client.h&gt;<br>#include &lt;avahi-client/lookup.h&gt;<br><br>#include &lt;avahi-common/cdecl.h&gt;<br>#include &lt;avahi-common/watch.h&gt;<br>#include &lt;avahi-common/malloc.h&gt;<br>#include &lt;avahi-common/error.h&gt;<br>

#include &lt;avahi-common/simple-watch.h&gt;<br><br>static AvahiSimplePoll *simple_poll = NULL;<br><br>int main(int argc , char* argv)<br>{<br>  AvahiClient *client = NULL;<br>  AvahiServiceBrowser *sb = NULL;<br>  int error;<br>

  int ret = 1;<br>  /*Allocate main loop object */<br><br>  if (!(simple_poll = avahi_simple_poll_new()))<br>  {<br>    //TODO<br>  }<br>//TODO<br>}<br><br>[/code]<br><br>And error is Here<br><br>lsf@lsf-laptop:~/mesh_project/dalesa/src/im$ gcc publish_service.c <br>

/tmp/ccavp1Yk.o: In function `main&#39;:<br>publish_service.c:(.text+0x27): undefined reference to `avahi_simple_poll_new&#39;<br>collect2: ld returned 1 exit status<br><br>What is the wrong with this? <br><br>Thank you. <br>

<br>Nuwan Gunarathna<br>
<br>_______________________________________________<br>
avahi mailing list<br>
<a href="mailto:avahi@lists.freedesktop.org">avahi@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/avahi" target="_blank">http://lists.freedesktop.org/mailman/listinfo/avahi</a><br>
<br></blockquote></div><br>You have to compile with ´pkg-config´ flags.<br><br>I don&#39;t remember what is the command, but I think that is <br>pkg-config --cflags --libs avahi-client<br clear="all">pkg-config --cflags --libs avahi-server<br>
<br>I&#39;m not sure, but yes, you need the CFlags.<br>-- <br>Atte. Félix Arreola Rodríguez,<br>Firmado con GPG, llave 223D869A<br>