[avahi] undefined reference to `avahi_simple_poll_new'

evanescent coolnuwan at gmail.com
Thu Jun 11 04:11:19 PDT 2009

I got this compilation error while I try to write avahi client to publish
I was trying to write the program from the scratch.

Here is the program.


#include <stdio.h>

#include <avahi-client/client.h>
#include <avahi-client/lookup.h>

#include <avahi-common/cdecl.h>
#include <avahi-common/watch.h>
#include <avahi-common/malloc.h>
#include <avahi-common/error.h>
#include <avahi-common/simple-watch.h>

static AvahiSimplePoll *simple_poll = NULL;

int main(int argc , char* argv)
  AvahiClient *client = NULL;
  AvahiServiceBrowser *sb = NULL;
  int error;
  int ret = 1;
  /*Allocate main loop object */

  if (!(simple_poll = avahi_simple_poll_new()))


And error is Here

lsf at lsf-laptop:~/mesh_project/dalesa/src/im$ gcc publish_service.c
/tmp/ccavp1Yk.o: In function `main':
publish_service.c:(.text+0x27): undefined reference to
collect2: ld returned 1 exit status

What is the wrong with this?

Thank you.

Nuwan Gunarathna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/avahi/attachments/20090611/03b538cb/attachment.html 

More information about the avahi mailing list