2009/6/11 evanescent <[email protected]> > Hi, > I got this compilation error while I try to write avahi client to publish > service. > I was trying to write the program from the scratch. > > Here is the program. > > [code] > > #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())) > { > //TODO > } > //TODO > } > > [/code] > > And error is Here > > l...@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 > `avahi_simple_poll_new' > collect2: ld returned 1 exit status > > What is the wrong with this? > > Thank you. > > Nuwan Gunarathna > > _______________________________________________ > avahi mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/avahi > > You have to compile with ´pkg-config´ flags.
I don't remember what is the command, but I think that is pkg-config --cflags --libs avahi-client pkg-config --cflags --libs avahi-server I'm not sure, but yes, you need the CFlags. -- Atte. Félix Arreola Rodríguez, Firmado con GPG, llave 223D869A
_______________________________________________ avahi mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/avahi
