Search code examples
c++cantavahi

Cannot build avahi4j: avahi4j_Client.c:18:32: fatal error: avahi-common/error.h: No such file or directory


Per the title of the post I'm trying to build avahi4j, but very quickly run into a wall after downloading: https://code.google.com/p/avahi4j/downloads/detail?name=avahi4j-0.1.tar.gz&can=2&q=

After extracting, and then executing ant clean all from within the avahi4j-0.1 directory, I receive the following error:

ant clean all
Buildfile: /home/myUser/Downloads/avahi4j-0.1/build.xml

clean:
     [exec] make: Entering directory `/home/myUser/Downloads/avahi4j-0.1/src'
     [exec] rm -f avahi4j_Client.o avahi4j_EntryGroup.o avahi4j_Avahi4JConstants.o thread-watch.o avahi4j_ServiceBrowser.o avahi4j_ServiceResolver.o avahi4j_RecordBrowser.o libavahi4j.so ./*~
     [exec] make: Leaving directory `/home/myUser/Downloads/avahi4j-0.1/src'
   [delete] Deleting directory /home/myUser/Downloads/avahi4j-0.1/classes

init:
    [mkdir] Created dir: /home/myUser/Downloads/avahi4j-0.1/classes

jnilib:
     [exec] make: Entering directory `/home/myUser/Downloads/avahi4j-0.1/src'
     [exec] gcc -I. -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux/ -I/usr/include/avahi-common  -O3 -fPIC -DVER_MAJ="0" -DVER_MIN="1"   -c -o avahi4j_Client.o avahi4j_Client.c
     [exec] make: Leaving directory `/home/myUser/Downloads/avahi4j-0.1/src'
     [exec] avahi4j_Client.c:18:32: fatal error: avahi-common/error.h: No such file or directory
     [exec]  #include <avahi-common/error.h>
     [exec]                                 ^
     [exec] compilation terminated.
     [exec] make: *** [avahi4j_Client.o] Error 1

BUILD FAILED
/home/myUser/Downloads/avahi4j-0.1/build.xml:75: exec returned: 2 

Total time: 0 seconds

Does anyone know what might be the problem?

EDIT: for completeness, I run the following commands, which produces the error:

wget https://avahi4j.googlecode.com/files/avahi4j-0.1.tar.gz
tar xzvf avahi4j-0.1.tar.gz  
cd avahi4j-0.1/
ant
ant clean all

Moreover, running find . -name error.h produces no results.


Solution

  • The libavahi-devel package installs the missing components.

    To resolve the issues presented by the question install the libavahi-devel package.