OSX Woes (v1.01)
Chris Nelson
chris at toysforbob.com
Sun Jul 3 04:12:51 EDT 2005
Fresh from my failure with the svn trunk, I decide to try my luck with
the v1.01 distribution. If I run into problems similar to the svn trunk
problems, I'll not be as verbose about them as I was in the previous email.
First, I grab SDL_sound v1.01 from the official website:
http://www.icculus.org/SDL_sound/downloads/SDL_sound-1.0.1.tar.gz
I run ./configure...
It doesn't find smpeg, even though the svn trunk did. config.log shows
this error:
---
configure:7291: checking for SMPEG - version >= 0.4.3
configure:7383: gcc -o conftest -g -O2 -I/usr/local/include/SDL
-D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/smpeg
-I/usr/local/include/SDL -D_THREAD_SAFE -I/usr/local/include/SDL
-D_THREAD_SAFE conftest.c -L/usr/local/lib -lSDLmain -lSDL -framework
Cocoa -framework OpenGL -L/usr/local/lib -lsmpeg -L/usr/local/lib
-lSDLmain -lSDL -framework Cocoa -framework OpenGL -L/usr/local/lib
-lSDLmain -lSDL -framework Cocoa -framework OpenGL >&5
configure:7365:14: missing terminating " character
configure: In function `SDL_main':
configure:7366: error: parse error before "minimum"
configure:7366: error: stray '\' in program
configure:7366:18: missing terminating " character
configure:7368:14: missing terminating " character
configure:7369: error: parse error before "correct"
configure:7369: error: stray '\' in program
configure:7369:22: missing terminating " character
configure:7371:14: missing terminating " character
configure:7372: error: parse error before "SMPEG_CONFIG"
configure:7372: error: stray '\' in program
configure:7372:15: missing terminating " character
configure:7373:14: missing terminating " character
configure:7374: error: stray '\' in program
configure:7374:11: missing terminating " character
configure:7386: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 7316 "configure"
---
So I comment out a big chunk of printfs on lines 7366 to 7376, which
does the trick.
I ./configure again. I get the following strange errors at the end:
---
config.status: creating Makefile
mv: Makefile: set owner/group (was: 501/0): Operation not permitted
config.status: creating decoders/Makefile
mv: decoders/Makefile: set owner/group (was: 501/0): Operation not permitted
config.status: creating decoders/timidity/Makefile
mv: decoders/timidity/Makefile: set owner/group (was: 501/0): Operation
not permitted
config.status: creating decoders/mpglib/Makefile
mv: decoders/mpglib/Makefile: set owner/group (was: 501/0): Operation
not permitted
config.status: creating playsound/Makefile
mv: playsound/Makefile: set owner/group (was: 501/0): Operation not
permitted
config.status: creating config.h
mv: config.h: set owner/group (was: 501/0): Operation not permitted
Holly:~/lithium/dep/osx/SDL_sound-1.0.1 emf$
---
Strange, because my user owns all these files. Still, I log in as root,
and ./configure again, and somehow those errors go away. configure
should not need to be run as root.
I run make. I get all the way to the "end", and then I get lots of
errors like this:
---
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1 root# make
make all-recursive
Making all in decoders
Making all in timidity
make[3]: Nothing to be done for `all'.
Making all in mpglib
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all-am'.
Making all in .
/bin/sh ./libtool --mode=link gcc -g -O2 -I/usr/local/include/SDL
-D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/smpeg
-I/usr/local/include/SDL -D_THREAD_SAFE -o libSDL_sound.la -rpath
/usr/local/lib -release 1.0 -version-info 1:0:0 SDL_sound.lo
alt_audio_convert.lo audio_convert.lo extra_rwops.lo
decoders/libdecoders.la decoders/timidity/libtimidity.la
decoders/mpglib/libmpglib.la -L/usr/local/lib -lSDLmain -lSDL -framework
Cocoa -framework OpenGL -L/usr/local/lib -lsmpeg -L/usr/local/lib
-lSDLmain -lSDL -framework Cocoa -framework OpenGL -lvorbis -lm
-lvorbisfile -lvorbisenc
*** Warning: This library needs some functionality provided by
/usr/local/lib/libsmpeg.la.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** Warning: This library needs some functionality provided by
/usr/local/lib/libsmpeg.la.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
rm -fr .libs/libSDL_sound.la .libs/libSDL_sound.* .libs/libSDL_sound-1.0.*
*** Warning: This library needs some functionality provided by -lSDLmain.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** Warning: This library needs some functionality provided by -lSDLmain.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** Warning: This library needs some functionality provided by -lSDLmain.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
(...)
*** Warning: This library needs some functionality provided by -lSDLmain.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** Warning: This library needs some functionality provided by -lSDLmain.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.
gcc -dynamiclib -flat_namespace -undefined suppress -o
.libs/libSDL_sound-1.0.1.0.0.dylib SDL_sound.lo alt_audio_convert.lo
audio_convert.lo extra_rwops.lo -all_load decoders/.libs/libdecoders.al
decoders/timidity/.libs/libtimidity.al
decoders/mpglib/.libs/libmpglib.al decoders/.libs/libdecoders.al
-L/usr/local/lib -lSDL -lm -lSDL -lm -lSDL -lm -lm -lm -lm -lm
decoders/timidity/.libs/libtimidity.al -lSDL -lm -lSDL -lm -lSDL -lm -lm
-lm -lm -lm decoders/mpglib/.libs/libmpglib.al -lSDL -lm -lSDL -lm -lSDL
-lm -lSDL -lstdc++ -lm -lm -lm -logg -lm -lSDL -lSDL -lvorbis -lm
-lvorbisfile -lvorbisenc -lc -install_name
/usr/local/lib/libSDL_sound-1.0.1.dylib -compatibility_version 2
-current_version 2.0
ld: multiple definitions of symbol ___Sound_DecoderFunctions_AIFF
decoders/.libs/libdecoders.al(aiff.lo) definition of
___Sound_DecoderFunctions_AIFF in section (__DATA,__const)
decoders/.libs/libdecoders.al(aiff.lo) definition of
___Sound_DecoderFunctions_AIFF in section (__DATA,__const)
ld: multiple definitions of symbol ___Sound_DecoderFunctions_AU
decoders/.libs/libdecoders.al(au.lo) definition of
___Sound_DecoderFunctions_AU in section (__DATA,__const)
decoders/.libs/libdecoders.al(au.lo) definition of
___Sound_DecoderFunctions_AU in section (__DATA,__const)
ld: multiple definitions of symbol ___Sound_DecoderFunctions_MPGLIB
decoders/.libs/libdecoders.al(mpglib.lo) definition of
___Sound_DecoderFunctions_MPGLIB in section (__DATA,__const)
decoders/.libs/libdecoders.al(mpglib.lo) definition of
___Sound_DecoderFunctions_MPGLIB in section (__DATA,__const)
ld: multiple definitions of symbol ___Sound_DecoderFunctions_SMPEG
decoders/.libs/libdecoders.al(smpeg.lo) definition of
___Sound_DecoderFunctions_SMPEG in section (__DATA,__const)
decoders/.libs/libdecoders.al(smpeg.lo) definition of
___Sound_DecoderFunctions_SMPEG in section (__DATA,__const)
ld: multiple definitions of symbol ___Sound_DecoderFunctions_OGG
decoders/.libs/libdecoders.al(ogg.lo) definition of
___Sound_DecoderFunctions_OGG in section (__DATA,__const)
decoders/.libs/libdecoders.al(ogg.lo) definition of
___Sound_DecoderFunctions_OGG in section (__DATA,__const)
(...)
decoders/mpglib/.libs/libmpglib.al(libmpglib_la-layer3.lo) definition of
_longLimit in section (__DATA,__common)
decoders/mpglib/.libs/libmpglib.al(libmpglib_la-layer3.lo) definition of
_longLimit in section (__DATA,__common)
ld: multiple definitions of symbol _shortLimit
decoders/mpglib/.libs/libmpglib.al(libmpglib_la-layer3.lo) definition of
_shortLimit in section (__DATA,__common)
decoders/mpglib/.libs/libmpglib.al(libmpglib_la-layer3.lo) definition of
_shortLimit in section (__DATA,__common)
ld: warning multiple definitions of symbol ___signbit
/usr/lib/gcc/darwin/3.3/libstdc++.a(signbit.o) private external
definition of ___signbit in section (__TEXT,__text)
/usr/lib/libm.dylib(fpmacros.o) definition of ___signbit
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libSDL_sound.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1 root#
---
I try the libtool tricks from the svn branch. libtool, libtool -static,
and libtool -dynamic all give the same errors:
---
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1 root# libtool -dynamic
-o libSDL_sound.la SDL_sound.lo alt_audio_convert.lo audio_convert.lo
extra_rwops.lo decoders/libdecoders.la decoders/timidity/libtimidity.la
decoders/mpglib/libmpglib.la -L/usr/local/lib -lSDLmain -lSDL -framework
Cocoa -framework OpenGL -L/usr/local/lib -lsmpeg -L/usr/local/lib
-lSDLmain -lSDL -framework Cocoa -framework OpenGL -lvorbis -lm
-lvorbisfile -lvorbisenc
libtool: file: decoders/libdecoders.la is not an object file (not
allowed in a library)
libtool: file: decoders/timidity/libtimidity.la is not an object file
(not allowed in a library)
libtool: file: decoders/mpglib/libmpglib.la is not an object file (not
allowed in a library)
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1 root#
---
Fine. They want object files, eh? My sources tell me that gcc is
excellent at making object files. So I make them manually. But first, it
should be notated that each of the lib*.la files it complains about give
a warning, when compiled the SDL_sound way:
---
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1/decoders/timidity root#
make
/bin/sh ../../libtool --mode=link gcc -g -O2 -I/usr/local/include/SDL
-D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/smpeg
-I/usr/local/include/SDL -D_THREAD_SAFE -o libtimidity.la common.lo
instrum.lo instrum_dls.lo mix.lo output.lo playmidi.lo readmidi.lo
resample.lo tables.lo timidity.lo -L/usr/local/lib -lSDLmain -lSDL
-framework Cocoa -framework OpenGL -L/usr/local/lib -lsmpeg
-L/usr/local/lib -lSDLmain -lSDL -framework Cocoa -framework OpenGL
-lvorbis -lm -lvorbisfile -lvorbisenc
*** Warning: This library needs some functionality provided by
/usr/local/lib/libsmpeg.la.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
rm -fr .libs/libtimidity.la .libs/libtimidity.* .libs/libtimidity.*
ar cru .libs/libtimidity.al common.lo instrum.lo instrum_dls.lo mix.lo
output.lo playmidi.lo readmidi.lo resample.lo tables.lo timidity.lo
ranlib .libs/libtimidity.al
creating libtimidity.la
(cd .libs && rm -f libtimidity.la && ln -s ../libtimidity.la libtimidity.la)
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1/decoders/timidity root#
---
Anyways, I make all these .la files with gcc. This gets me closer.
I then must use this command to generate libSDL_sound.la:
---
libtool -static -o libSDL_sound.la SDL_sound.lo alt_audio_convert.lo
audio_convert.lo extra_rwops.lo -L/usr/local/lib -lSDLmain -lSDL
-framework Cocoa -framework OpenGL -L/usr/local/lib -lsmpeg
-L/usr/local/lib -lSDL -framework Cocoa -framework OpenGL -lvorbis
-lvorbisfile -lvorbisenc decoders/*.o decoders/mpglib/*.o
---
This gives me heaps of errors like this:
---
libtool: warning same member name (SDL_mouse.o) in output file used for
input files: /usr/local/lib/libSDL.a(SDL_mouse.o) and:
/usr/local/lib/libSDL.a(SDL_mouse.o) due to use of basename, truncation
and blank padding
libtool: warning same member name (SDL_nullevents.o) in output file used
for input files: /usr/local/lib/libSDL.a(SDL_nullevents.o) and:
/usr/local/lib/libSDL.a(SDL_nullevents.o) due to use of basename,
truncation and blank padding
libtool: warning same member name (SDL_nullmouse.o) in output file used
for input files: /usr/local/lib/libSDL.a(SDL_nullmouse.o) and:
/usr/local/lib/libSDL.a(SDL_nullmouse.o) due to use of basename,
truncation and blank padding
libtool: warning same member name (SDL_nullvideo.o) in output file used
for input files: /usr/local/lib/libSDL.a(SDL_nullvideo.o) and:
/usr/local/lib/libSDL.a(SDL_nullvideo.o) due to use of basename,
truncation and blank padding
libtool: warning same member name (SDL_pixels.o) in output file used for
input files: /usr/local/lib/libSDL.a(SDL_pixels.o) and:
/usr/local/lib/libSDL.a(SDL_pixels.o) due to use of basename, truncation
and blank padding
libtool: warning same member name (SDL_quit.o) in output file used for
input files: /usr/local/lib/libSDL.a(SDL_quit.o) and:
/usr/local/lib/libSDL.a(SDL_quit.o) due to use of basename, truncation
and blank padding
libtool: warning same member name (SDL_resize.o) in output file used for
input files: /usr/local/lib/libSDL.a(SDL_resize.o) and:
/usr/local/lib/libSDL.a(SDL_resize.o) due to use of basename, truncation
and blank padding
libtool: warning same member name (SDL_romaudio.o) in output file used
for input files: /usr/local/lib/libSDL.a(SDL_romaudio.o) and:
/usr/local/lib/libSDL.a(SDL_romaudio.o) due to use of basename,
truncation and blank padding
---
And I finally get playsound to work!! Note how I'm linking directly to
the .o files, and not the library files on the first line:
---
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1/playsound root# g++
-o playsound playsound-playsound.o -L../ -lSDL_sound -L/usr/local/lib
-lSDLmain -lSDL -framework Cocoa -framework OpenGL -L/usr/local/lib
-lsmpeg -L/usr/local/lib -lSDLmain -lSDL -framework Cocoa -framework
OpenGL -lvorbis -lvorbisfile -lvorbisenc ../decoders/*.o
../decoders/mpglib/*.o ../decoders/timidity/*.o
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1/playsound root# ./playsound
USAGE: ./playsound [...options...] [soundFile1] ... [soundFileN]
Options:
--rate n Playback at sample rate of n HZ.
--format fmt Playback in fmt format (see below).
--channels n Playback on n channels (1 or 2).
--decodebuf n Buffer n decoded bytes at a time (default 16384).
--audiobuf n Buffer n samples to audio device (default 4096).
--volume n Playback volume multiplier (default 1.0).
--stdin [ext] Read from stdin (treat data as format [ext])
--version Display version information and exit.
--decoders List supported data formats and exit.
--predecode Decode entire sample before playback.
--loop n Loop playback n times.
--seek list List of seek points and playback durations.
--credits Shameless promotion.
--help Display this information and exit.
Valid arguments to the --format option are:
U8 Unsigned 8-bit.
S8 Signed 8-bit.
U16LSB Unsigned 16-bit (least significant byte first).
U16MSB Unsigned 16-bit (most significant byte first).
S16LSB Signed 16-bit (least significant byte first).
S16MSB Signed 16-bit (most significant byte first).
Valid arguments to the --seek options look like:
--seek "mm:SS:ss;mm:SS:ss;mm:SS:ss"
Where the first "mm:SS:ss" is the position, in minutes,
seconds and milliseconds to seek to at start of playback. The
next mm:SS:ss is how long to play audio from that point.
The third mm:SS:ss is another seek after the duration of
playback has completed. If the final playback duration is
omitted, playback continues until the end of the file.
The "mm" and "SS" portions may be omitted. --loop
and --seek can coexist.
Holly:/Users/emf/lithium/dep/osx/SDL_sound-1.0.1/playsound root#
---
So SDL_Sound v1.01 (and possibly svn trunk revision 503) KINDA compile
under OSX. At least, the sample program will compile, run, and play back
ogg and mp3 files. But I'm linking directly to .o files, and I can't
install the libraries. My lack of experience with unix-style libraries
is definitely a weakness, here. I hope somebody with more experience can
tell me what I'm doing wrong.
So, does anybody know what I'm doing wrong, or, perhaps more generally,
how to get SDL_sound to work under OSX, so I can link my programs to it?
I bet the solution, after these ultra-long emails, is going to be more
or less a one-liner.
More information about the sdlsound
mailing list