我怎样才能让钢琴在OS X上正确编译?



我想让钢琴钢琴在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!

我已经使用自制安装我没有的依赖关系,如faad2libid3tag,但我还没有在谷歌上找到任何关于安装pthreads或如何判断我是否已经拥有的东西。

无论如何,当我尝试编译钢琴时,我得到的是:

####: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$

这个问题已经在piano的主控和开发分支中得到了解决。请注意,有一个问题/补丁可用于自制,它解决了未为id3tag.pc生成pkg-config的问题。此补丁尚未集成到自制程序中。

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

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

这是您试图构建的程序中的可移植性错误:它假设strndup()可用,而它不是。

幸运的是,实现您自己的strndup替换很简单,只要给出它的功能描述。

或者你可以检查fly.c:也许用strdup代替strndup也可以。

相关内容

  • 没有找到相关文章

最新更新