1

我正在尝试让pianobarfly在 OS X 上工作,但无法正确编译。

从安装文档中选择的文本:

Dependencies
------------

gmake
libao               http://www.xiph.org/ao/
libfaad2            http://www.audiocoding.com/downloads.html
AND/OR libmad       http://www.underbit.com/products/mad/
pthreads
libid3tag           http://www.underbit.com/products/mad/
UTF-8 console/locale!



Building
--------

If you have all of the dependencies listed above just type

    make clean && make

NOTE: The above won't work on Mac OS X (Snow Leopard) since c99 targets i386
and cc (gcc4.2) targets x86_64. If you've built supporting libraries
(libao, etc.) using gcc, you'll be unable to link. You can work around
this issue by overriding CFLAGS[1]

    make clean && make CFLAGS="-O2 -DNDEBUG -W64" && make DISABLE_FAAD=1

我想我有所有的依赖,除了我不确定我是否有pthreads,我假设我的系统默认是UTF-8 console/locale!

我已经使用自制软件安装了我没有的依赖项,比如faad2and libid3tag,但我没有在谷歌上找到任何关于安装pthreads或如何判断我是否已经拥有的依赖项。

无论如何,当我尝试编译pianobarfly时,这就是我得到的:

####:pianobarfly user$ make clean && make CFLAGS="-O2 -DNDEBUG -W64" && make DISABLE_FAAD=1
rm -f src/main.o src/player.o src/settings.o src/terminal.o src/ui_act.o src/ui.o\
src/ui_readline.o src/ui_dispatch.o src/fly.o src/fly_id3.o src/fly_mp4.o\
src/libpiano/crypt.o src/libpiano/piano.o src/libpiano/xml.o\
src/libwaitress/waitress.o src/libwaitress/waitress.o/test.o \
            src/libezxml/ezxml.o src/libpiano/crypt.lo src/libpiano/piano.lo\
          src/libpiano/xml.lo src/libwaitress/waitress.lo \
            src/libezxml/ezxml.lo pianobarfly libpiano.so* libpiano.a waitress-test
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/main.o src/main.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/player.o src/player.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/settings.o src/settings.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/terminal.o src/terminal.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_act.o src/ui_act.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui.o src/ui.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_readline.o src/ui_readline.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/ui_dispatch.o src/ui_dispatch.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/fly.o src/fly.c
src/fly.c: In function ‘_BarFlyParseCoverArtURL’:
src/fly.c:733: warning: implicit declaration of function ‘strndup’
src/fly.c:734: warning: assignment makes pointer from integer without a cast
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/fly_id3.o src/fly_id3.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/fly_mp4.o src/fly_mp4.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/libpiano/crypt.o src/libpiano/crypt.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/libpiano/piano.o src/libpiano/piano.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/libpiano/xml.o src/libpiano/xml.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/libwaitress/waitress.o src/libwaitress/waitress.c
c99 -O2 -DNDEBUG -W64 -I src/libpiano -I src/libwaitress \
            -I src/libezxml -DENABLE_FAAD \
            -DENABLE_MAD -DENABLE_ID3TAG -c -o src/libezxml/ezxml.o src/libezxml/ezxml.c
c99 -O2 -DNDEBUG -W64  src/main.o src/player.o src/settings.o src/terminal.o src/ui_act.o\
    src/ui.o src/ui_readline.o src/ui_dispatch.o src/fly.o src/fly_id3.o src/fly_mp4.o\
    src/libpiano/crypt.o src/libpiano/piano.o src/libpiano/xml.o \
            src/libwaitress/waitress.o src/libezxml/ezxml.o -lao -lpthread -lm \
            -lfaad -lmad -lid3tag -o pianobarfly
Undefined symbols for architecture x86_64:
  "_strndup", referenced from:
      _BarFlyOpen in fly.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [pianobarfly] Error 1
####:pianobarfly user$
4

2 回答 2

1

这已在pianobarfly 的 master 和 development 分支中得到解决。请注意,有一个可用于自制软件的问题/补丁,它解决了未为 id3tag.pc 生成 pkg-config 的问题。此补丁尚未(尚未)集成到自制软件中。

见:https ://github.com/mxcl/homebrew/pull/7973

另见:https ://github.com/ghuntley/pianobarfly/issues/3

于 2011-10-05T05:22:22.877 回答
0

这是您尝试构建的程序中的一个可移植性错误:它假定它strndup()是可用的,但它不是。

幸运的是,只要描述了它的作用,实现您自己的strndup替换是微不足道的。

或者您可以检查fly.c:也许替换strndupstrdup可以。

于 2011-10-03T04:09:32.977 回答