How can I get pianobarfly to compile correctly on OS X?
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 tr开发者_JS百科y 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$
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
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.
精彩评论