Problem compiling SDL on OSX: The Unix Way

Hello !

SDL CVS does not create a dynamic SDL_main lib.
Is this wanted or a bug ?

As a result of this: i cannot compile SDL_mixer on OSX.

All the other libs: SDL_net, SDL_ttf2 and so on work without problems.

CU

Hello !

SDL CVS does not create a dynamic SDL_main lib.
Is this wanted or a bug ?

It’s intentional.

As a result of this: i cannot compile SDL_mixer on OSX.

All the other libs: SDL_net, SDL_ttf2 and so on work without problems.

SDL_mixer compiles just fine over here.

Bye,

MaxAm 02.08.2004 um 12:13 schrieb Torsten Giebl:

Hello !

SDL_mixer compiles just fine over here.

I used the latest CVS versions from SDL and SDL_mixer and
get that error when compiling SDL_mixer :

/bin/sh ./libtool --mode=link gcc -g -O2 -I/usr/local/include/SDL
-D_THREAD_SAFE -DUSE_RWOPS -DCMD_MUSIC -DWAV_MUSIC -DMOD_MUSIC -I./mikmod
-DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI
-I./native_midi -o libSDL_mixer.la -rpath /usr/local/lib -no-undefined
-release 1.2 -version-info 2:4:2 load_aiff.lo load_voc.lo load_ogg.lo
mixer.lo music.lo music_cmd.lo music_ogg.lo wavestream.lo
effect_position.lo effect_stereoreverse.lo effects_internal.lo
mikmod/libmikmod.la timidity/libtimidity.la native_midi/libnativemidi.la
-framework QuickTime -L/usr/local/lib -lSDLmain -lSDL -framework Cocoa
-framework OpenGL
gcc -dynamiclib -o .libs/libSDL_mixer-1.2.0.2.4.dylib .libs/load_aiff.o
.libs/load_voc.o .libs/load_ogg.o .libs/mixer.o .libs/music.o
.libs/music_cmd.o .libs/music_ogg.o .libs/wavestream.o
.libs/effect_position.o .libs/effect_stereoreverse.o
.libs/effects_internal.o -all_load mikmod/.libs/libmikmod.a
timidity/.libs/libtimidity.a native_midi/.libs/libnativemidi.a -framework
QuickTime -L/usr/local/lib -lSDLmain /usr/local/lib/libSDL.dylib
-framework Cocoa -framework OpenGL -install_name
/usr/local/lib/libSDL_mixer-1.2.0.dylib -compatibility_version 3
-current_version 3.4
/usr/bin/libtool: internal link edit command failed
ld: Undefined symbols:
_SDL_main
make[1]: *** [libSDL_mixer.la] Error 1
make: *** [all-recursive] Error 1
Torsten-Giebls-Computer:~/SDL/SDL_mixer wizard$

CU

Hello !

Really, has nobody else this problem ?!?!?

CU>> SDL_mixer compiles just fine over here.

I used the latest CVS versions from SDL and SDL_mixer and
get that error when compiling SDL_mixer :

/bin/sh ./libtool --mode=link gcc -g -O2 -I/usr/local/include/SDL
-D_THREAD_SAFE -DUSE_RWOPS -DCMD_MUSIC -DWAV_MUSIC -DMOD_MUSIC -I./mikmod
-DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI
-I./native_midi -o libSDL_mixer.la -rpath /usr/local/lib -no-undefined
-release 1.2 -version-info 2:4:2 load_aiff.lo load_voc.lo load_ogg.lo
mixer.lo music.lo music_cmd.lo music_ogg.lo wavestream.lo
effect_position.lo effect_stereoreverse.lo effects_internal.lo
mikmod/libmikmod.la timidity/libtimidity.la native_midi/libnativemidi.la
-framework QuickTime -L/usr/local/lib -lSDLmain -lSDL -framework Cocoa
-framework OpenGL
gcc -dynamiclib -o .libs/libSDL_mixer-1.2.0.2.4.dylib .libs/load_aiff.o
.libs/load_voc.o .libs/load_ogg.o .libs/mixer.o .libs/music.o
.libs/music_cmd.o .libs/music_ogg.o .libs/wavestream.o
.libs/effect_position.o .libs/effect_stereoreverse.o
.libs/effects_internal.o -all_load mikmod/.libs/libmikmod.a
timidity/.libs/libtimidity.a native_midi/.libs/libnativemidi.a -framework
QuickTime -L/usr/local/lib -lSDLmain /usr/local/lib/libSDL.dylib
-framework Cocoa -framework OpenGL -install_name
/usr/local/lib/libSDL_mixer-1.2.0.dylib -compatibility_version 3
-current_version 3.4
/usr/bin/libtool: internal link edit command failed
ld: Undefined symbols:
_SDL_main
make[1]: *** [libSDL_mixer.la] Error 1
make: *** [all-recursive] Error 1
Torsten-Giebls-Computer:~/SDL/SDL_mixer wizard$

Why don’t you give me the exact commands you used to get to that point,
and the exact version of OSX you’re using. I’ll see if I have / can
solve these problems on my 10.3.4 system.On Aug 5, 2004, at 6:43 PM, Torsten Giebl wrote:

Hello !

Really, has nobody else this problem ?!?!?

CU

SDL_mixer compiles just fine over here.

I used the latest CVS versions from SDL and SDL_mixer and
get that error when compiling SDL_mixer :

/bin/sh ./libtool --mode=link gcc -g -O2 -I/usr/local/include/SDL
-D_THREAD_SAFE -DUSE_RWOPS -DCMD_MUSIC -DWAV_MUSIC -DMOD_MUSIC
-I./mikmod
-DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI
-I./native_midi -o libSDL_mixer.la -rpath /usr/local/lib
-no-undefined
-release 1.2 -version-info 2:4:2 load_aiff.lo load_voc.lo load_ogg.lo
mixer.lo music.lo music_cmd.lo music_ogg.lo wavestream.lo
effect_position.lo effect_stereoreverse.lo effects_internal.lo
mikmod/libmikmod.la timidity/libtimidity.la
native_midi/libnativemidi.la
-framework QuickTime -L/usr/local/lib -lSDLmain -lSDL -framework Cocoa
-framework OpenGL
gcc -dynamiclib -o .libs/libSDL_mixer-1.2.0.2.4.dylib
.libs/load_aiff.o
.libs/load_voc.o .libs/load_ogg.o .libs/mixer.o .libs/music.o
.libs/music_cmd.o .libs/music_ogg.o .libs/wavestream.o
.libs/effect_position.o .libs/effect_stereoreverse.o
.libs/effects_internal.o -all_load mikmod/.libs/libmikmod.a
timidity/.libs/libtimidity.a native_midi/.libs/libnativemidi.a
-framework
QuickTime -L/usr/local/lib -lSDLmain /usr/local/lib/libSDL.dylib
-framework Cocoa -framework OpenGL -install_name
/usr/local/lib/libSDL_mixer-1.2.0.dylib -compatibility_version 3
-current_version 3.4
/usr/bin/libtool: internal link edit command failed
ld: Undefined symbols:
_SDL_main
make[1]: *** [libSDL_mixer.la] Error 1
make: *** [all-recursive] Error 1
Torsten-Giebls-Computer:~/SDL/SDL_mixer wizard$


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

  • Donny Viszneki

Hello !

Why don’t you give me the exact commands you used to get to that point,
and the exact version of OSX you’re using. I’ll see if I have / can
solve these problems on my 10.3.4 system.

I am using 10.3.4 with all the latest updates
from the Automatic Update System in OSX.
I installed all the Software from the Restore CDs and the complete
Developer Tools.

I can compile SDL_ttf2, SDL_net, SDL_image, but only SDL_mixer fails.

I copy&pasted the error message in that mail :

http://twomix.devolution.com/pipermail/sdl/2004-August/063727.html

CU

Hello !

I used the standard commands:

./autogen.sh
./configure
make

CU

At 0:43 +0200 6/8/2004, Torsten Giebl wrote:

Hello !
Really, has nobody else this problem ?!?!?

i have no problems whatsoever using SDL under OSX ‘the normal unix
way’, but i don’t use libtool …–

;

Jay Vaughan

Hello !

ve no problems whatsoever using SDL under OSX ‘the normal unix
way’, but i don’t use libtool …

I don?t have a problem with using SDL directly,
but with getting SDL_mixer compiled.

CU

Hello !

SDL_mixer compiles just fine over here.

I used the latest CVS versions from SDL and SDL_mixer and
get that error when compiling SDL_mixer :

/bin/sh ./libtool --mode=link gcc -g -O2 -I/usr/local/include/SDL
-D_THREAD_SAFE -DUSE_RWOPS -DCMD_MUSIC -DWAV_MUSIC -DMOD_MUSIC
-I./mikmod
-DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI
-I./native_midi -o libSDL_mixer.la -rpath /usr/local/lib
-no-undefined
-release 1.2 -version-info 2:4:2 load_aiff.lo load_voc.lo load_ogg.lo
mixer.lo music.lo music_cmd.lo music_ogg.lo wavestream.lo
effect_position.lo effect_stereoreverse.lo effects_internal.lo
mikmod/libmikmod.la timidity/libtimidity.la
native_midi/libnativemidi.la
-framework QuickTime -L/usr/local/lib -lSDLmain -lSDL -framework Cocoa
-framework OpenGL
gcc -dynamiclib -o .libs/libSDL_mixer-1.2.0.2.4.dylib
.libs/load_aiff.o
.libs/load_voc.o .libs/load_ogg.o .libs/mixer.o .libs/music.o
.libs/music_cmd.o .libs/music_ogg.o .libs/wavestream.o
.libs/effect_position.o .libs/effect_stereoreverse.o
.libs/effects_internal.o -all_load mikmod/.libs/libmikmod.a
timidity/.libs/libtimidity.a native_midi/.libs/libnativemidi.a
-framework
QuickTime -L/usr/local/lib -lSDLmain /usr/local/lib/libSDL.dylib
-framework Cocoa -framework OpenGL -install_name
/usr/local/lib/libSDL_mixer-1.2.0.dylib -compatibility_version 3
-current_version 3.4
/usr/bin/libtool: internal link edit command failed
ld: Undefined symbols:
_SDL_main
make[1]: *** [libSDL_mixer.la] Error 1
make: *** [all-recursive] Error 1
Torsten-Giebls-Computer:~/SDL/SDL_mixer wizard$

OK, I now can reproduce the problem, and the error you are pasting here
already shows quite clearly what is going on: It tries to link
libSDLmain into SDL_mixer. This is of course wrong/bad, since we are
trying to create a library here, not a binary.

In the end, this boils down to a design flaw/shortcoming of sdl-config
and the whole SDL_main business . For now a simple&quick fix
would be to add code to the SDL_mixer build chain which filters
-lSDLmain out of the LDFLAGS when linking libs.

A mid-term solution might be to enhance sdl-config with a new --libs
option, like “–libs-for-lib-linking” – but of course that’s ugly, and
it would mean you have to rely on the very very newest SDL release for
your stuff to build.

Finally, a long term solution (for SDL 2.0 :slight_smile: would be to redo the
whole SDL_main stuff in a better / more portable fashion. Shouldn’t be
so hard, actually, and I have some ideas for this – alas, this won’t
help you now either :slight_smile:

Bye,

MaxAm 02.08.2004 um 22:22 schrieb Torsten Giebl:

Hello !

Why don’t you give me the exact commands you used to get to that
point,
and the exact version of OSX you’re using. I’ll see if I have / can
solve these problems on my 10.3.4 system.

I am using 10.3.4 with all the latest updates
from the Automatic Update System in OSX.
I installed all the Software from the Restore CDs and the complete
Developer Tools.

I can compile SDL_ttf2, SDL_net, SDL_image, but only SDL_mixer fails.

I copy&pasted the error message in that mail :

http://twomix.devolution.com/pipermail/sdl/2004-August/063727.html

I can get that problem too, but Max Horn has already tracked down the
problem. I suggest for now, just get the latest release version from
ports using http://darwinports.opendarwin.org/

CU


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

  • Donny VisznekiOn Aug 6, 2004, at 5:58 AM, Torsten Giebl wrote:

Hello !

Why don’t you give me the exact commands you used to get to that
point,
and the exact version of OSX you’re using. I’ll see if I have / can
solve these problems on my 10.3.4 system.

I am using 10.3.4 with all the latest updates
from the Automatic Update System in OSX.
I installed all the Software from the Restore CDs and the complete
Developer Tools.

I can compile SDL_ttf2, SDL_net, SDL_image, but only SDL_mixer fails.

I copy&pasted the error message in that mail :

http://twomix.devolution.com/pipermail/sdl/2004-August/063727.html

I can get that problem too, but Max Horn has already tracked down the
problem. I suggest for now, just get the latest release version from
ports using http://darwinports.opendarwin.org/

Or build the latest versions yourself. Or get them via Fink
(http://fink.sourceforge.net).

Bye,

MaxAm 07.08.2004 um 08:36 schrieb Donny Viszneki:

On Aug 6, 2004, at 5:58 AM, Torsten Giebl wrote:

Hello !

In the end, this boils down to a design flaw/shortcoming of sdl-config
and the whole SDL_main business . For now a simple&quick fix
would be to add code to the SDL_mixer build chain which filters
-lSDLmain out of the LDFLAGS when linking libs.

I don’t know anything about this Autobuild Stuff.
Is anybody here able to fix this ?

Why is this stuff only making SDL_mixer not compilable
and not all the other libs SDL_net, SDL_ttf2 too ?

CU

Hello !

I don’t know anything about this Autobuild Stuff.
Is anybody here able to fix this ?

Please fix this. It really sucks when getting errors
when compiling SDL_mixer. Removing -lSDL_main solved the problem,
but i got a new one when compiling SDL_mixer with SMPEG support.

CU