如何让pianobarfly 在 OS X 上正确编译?

发布于 2024-12-07 18:09:19 字数 5550 浏览 0 评论 0原文

我试图让 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!

我已经使用 homebrew 安装了我没有的依赖项,例如 faad2libid3tag,但我还没有出现过谷歌上有关于安装的任何信息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$

I'm trying to get pianobarfly working on OS X and can't get it to compile correctly.

Selected text from the install document:

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

I think I have all the dependencies, except I'm not sure if I have pthreads or not, and I'm assuming my system default is UTF-8 console/locale!

I have used homebrew to install the dependencies I didn't have, like faad2 and libid3tag, but I haven't been to turn up anything on google about installing pthreads or how to tell if I have that already or not.

Anyhow, when I try to complile pianobarfly, this is what I get:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泛滥成性 2024-12-14 18:09:19

这个问题已经在 Pianobarfly 的 master 和开发分支中得到解决。请注意,自制程序有一个问题/补丁可以解决未为 id3tag.pc 生成 pkg-config 的问题。该补丁尚未集成到自制程序中。

请参阅:https://github.com/mxcl/homebrew/pull/7973

另请参阅:https://github.com/ghuntley/pianobarfly/issues/3

This has been resolved within the master and development branch of pianobarfly. Please be aware that there is an issue/patch available for homebrew which resolves a issue where pkg-config was not being generated for id3tag.pc. This patch has not (yet) been integrated into homebrew.

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

Also see: https://github.com/ghuntley/pianobarfly/issues/3

葬﹪忆之殇 2024-12-14 18:09:19

这是您尝试构建的程序中的一个可移植性错误:它假设 strndup() 可用,但事实并非如此。

幸运的是,根据描述strndup 替换很简单a> 它的作用。

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

This is a portability bug in the program you are trying to build: it assumes that strndup() is available, and it isn't.

Fortunately, it's trivial to implement your own strndup replacement, given a description of what it does.

Or you may check fly.c: perhaps replacing strndup with strdup also works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文