<br><br><div class="gmail_quote">2009/6/11 evanescent <span dir="ltr"><<a href="mailto:coolnuwan@gmail.com">coolnuwan@gmail.com</a>></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 <stdio.h><br>
<br>#include <avahi-client/client.h><br>#include <avahi-client/lookup.h><br><br>#include <avahi-common/cdecl.h><br>#include <avahi-common/watch.h><br>#include <avahi-common/malloc.h><br>#include <avahi-common/error.h><br>
#include <avahi-common/simple-watch.h><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':<br>publish_service.c:(.text+0x27): undefined reference to `avahi_simple_poll_new'<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'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'm not sure, but yes, you need the CFlags.<br>-- <br>Atte. Félix Arreola Rodríguez,<br>Firmado con GPG, llave 223D869A<br>