D.gnu - Problems with SDL_Mixer on Mac
- Mark Harviston (20/20) Mar 15 2006 I downloaded the files from Anders's website and modified the code for a...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (10/26) Mar 15 2006 That should be OK.
- Mark Harviston (11/53) Mar 16 2006 Thank you, but
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (5/12) Mar 16 2006 Is the mixer.d actually *in* the D library ?
- Mark Harviston (8/25) Mar 16 2006 SDL Mixer is an addon.
I downloaded the files from Anders's website and modified the code for a game I am making. (its called Ugly Tank, if you care) and now I want to add sound. I promptly imported sdl.audio, and sdl.mixer. sdl.audio imported fine. sdl.mixer gave a link error: /usr/bin/ld: Undefined Symbols: --ModuleInfo_5mixer collect2 ld returned with 1 exit status I know SDL_Mixer works, because I loaded the aliens example from the SDL website, and it uses SDL_Mixer. I know what the problem is now(the above is still valid) the makefile is linking to the Framework and the *.os in the sdl/* local directory. If i link (-L/sw/lib) to the fink librarys, the mixer problems would seem to go away, but I am left with "can't locate file for: -lSDL_d", so how do I get both in the same directory? can I copy the SDL_Mixer stuff from /sw/lib/? what files do I copy? thanks in advance. --Mark
Mar 15 2006
Mark Harviston wrote:sdl.audio imported fine. sdl.mixer gave a link error: /usr/bin/ld: Undefined Symbols: --ModuleInfo_5mixer collect2 ld returned with 1 exit statusThat would be a symbol from the D code.I know SDL_Mixer works, because I loaded the aliens example from the SDL website, and it uses SDL_Mixer. I know what the problem is now(the above is still valid) the makefile is linking to the Framework and the *.os in the sdl/* local directory.That should be OK.If i link (-L/sw/lib) to the fink librarys, the mixer problems would seem to go away, but I am left with "can't locate file for: -lSDL_d", so how do I get both in the same directory?You can add both of them, like this: -L . -L/sw/lib SDL_d was just a lib that I did for the D "sdl/*.o", so you could add the object files instead of that one.can I copy the SDL_Mixer stuff from /sw/lib/? what files do I copy?Better to leave Fink's SDL_Mixer dylibs in /sw/lib, but you can copy the "libSDL_d.a" to /usr/local/lib ? Hopefully I'll get some time to clean this up soon.. --anders
Mar 15 2006
Anders F Björklund wrote:Mark Harviston wrote:Thank you, but make LDFLAGS="-L/sw/lib/ -L. still gives me the __ModuleInfo_5mixer undefined error again I have tried many variations, like: make LDFLAGS="-L. -L./sdl/ -L/sw/lib" so maybe that is not the problem. ideas? like I said I know C++ programs can link to it, so theres gotta be a way for D programs to. --Marksdl.audio imported fine. sdl.mixer gave a link error: /usr/bin/ld: Undefined Symbols: --ModuleInfo_5mixer collect2 ld returned with 1 exit statusThat would be a symbol from the D code.I know SDL_Mixer works, because I loaded the aliens example from the SDL website, and it uses SDL_Mixer. I know what the problem is now(the above is still valid) the makefile is linking to the Framework and the *.os in the sdl/* local directory.That should be OK.If i link (-L/sw/lib) to the fink librarys, the mixer problems would seem to go away, but I am left with "can't locate file for: -lSDL_d", so how do I get both in the same directory?You can add both of them, like this: -L . -L/sw/lib SDL_d was just a lib that I did for the D "sdl/*.o", so you could add the object files instead of that one.can I copy the SDL_Mixer stuff from /sw/lib/? what files do I copy?Better to leave Fink's SDL_Mixer dylibs in /sw/lib, but you can copy the "libSDL_d.a" to /usr/local/lib ? Hopefully I'll get some time to clean this up soon.. --anders
Mar 16 2006
Mark Harviston wrote:Thank you, but make LDFLAGS="-L/sw/lib/ -L. still gives me the __ModuleInfo_5mixer undefined error again I have tried many variations, like: make LDFLAGS="-L. -L./sdl/ -L/sw/lib" so maybe that is not the problem. ideas?Is the mixer.d actually *in* the D library ? Maybe you need another .o, beyond the .a ? (I think SDL_Mixer is an add-on to SDL, yes?) --anders
Mar 16 2006
Anders F Björklund wrote:Mark Harviston wrote:SDL Mixer is an addon. O.K. I added mixer.o to the .o list in the makefile I tried a make and a make LDFLAGS="-L. -L/sw/lib -lSDL_mixer" and low and behold it worked. my main problem there was I forgot the _ but I figured that out. Thanks for all the help, --MarkThank you, but make LDFLAGS="-L/sw/lib/ -L. still gives me the __ModuleInfo_5mixer undefined error again I have tried many variations, like: make LDFLAGS="-L. -L./sdl/ -L/sw/lib" so maybe that is not the problem. ideas?Is the mixer.d actually *in* the D library ? Maybe you need another .o, beyond the .a ? (I think SDL_Mixer is an add-on to SDL, yes?) --anders
Mar 16 2006