为什么Avahi" ant test-browse"用" libavahi4j.so失败:未定义的符号:avahi_malloc"?

时间:2014-05-30 01:43:45

标签: java c++ c ant avahi

我能够按照instructions成功构建avahi,但是快速开始运行" ant test-browse"导致符号查找错误,我对如何继续解决此问题感到困惑。我确实发现以下显示类似问题的post,但无法取得任何进展(似乎线程从未公开解决)。这是我看到的错误输出:

myUser@ubuntu:~/Downloads/avahi4j-0.1$ ant test-browse
Buildfile: /home/myUser/Downloads/avahi4j-0.1/build.xml

init:

compile:
    [javac] /home/myUser/Downloads/avahi4j-0.1/build.xml:109: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

jar:

jnilib:
     [exec] make: Entering directory `/home/myUser/Downloads/avahi4j-0.1/src'
     [exec] make: Nothing to be done for `all'.
     [exec] make: Leaving directory `/home/myUser/Downloads/avahi4j-0.1/src'

test-browse:
     [java] Avahi4J v0.1-0
     [java] /usr/lib/jvm/java-7-oracle/jre/bin/java: symbol lookup error: /home/myUser/Downloads/avahi4j-0.1/libavahi4j.so: undefined symbol: avahi_malloc

BUILD FAILED
/home/myUser/Downloads/avahi4j-0.1/build.xml:185: Java returned: 127

Total time: 0 seconds

1 个答案:

答案 0 :(得分:0)

最后找到了一个解决方法:export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libavahi-common.so:/usr/lib/x86_64-linux-gnu/libavahi-client.so

如果有人能说明为什么需要这种手动黑客攻击,我会很乐意为什么标准构建过程对我不起作用(这是在Ubuntu上)。