Hi,
I’d like to write my own mixer application using SDL_audio, but I’ve been unable
to get past some difficulties in building the example code I found here:
http://de.wikibooks.org/wiki/SDL:_Audio
Compiling in Xcode gives me this:
“_SDL_main”, referenced from:
-[SDLMain applicationDidFinishLaunching:] in SDLMain.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Compiling from the command line yields more info:
$ gcc -Wall main.cpp
main.cpp: In function ‘void Callback(void*, Uint8*, int)’:
main.cpp:23: warning: comparison between signed and unsigned integer expressions
Undefined symbols:
"_SDL_OpenAudio", referenced from:
play() in ccZ1Afdo.o
"___gxx_personality_v0", referenced from:
___gxx_personality_v0$non_lazy_ptr in ccZ1Afdo.o
"_SDL_RWFromFile", referenced from:
play() in ccZ1Afdo.o
"_main", referenced from:
start in crt1.10.5.o
"_SDL_MixAudio", referenced from:
Callback(void*, unsigned char*, int)in ccZ1Afdo.o
"_SDL_Delay", referenced from:
SDL_main() in ccZ1Afdo.o
"_SDL_LoadWAV_RW", referenced from:
play() in ccZ1Afdo.o
"_SDL_Init", referenced from:
init_sdl() in ccZ1Afdo.o
"_SDL_PauseAudio", referenced from:
play() in ccZ1Afdo.o
"_SDL_Quit", referenced from:
_SDL_Quit$non_lazy_ptr in ccZ1Afdo.o
"_SDL_GetError", referenced from:
play() in ccZ1Afdo.o
"_SDL_SetVideoMode", referenced from:
init_sdl() in ccZ1Afdo.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
It’s probably pretty obvious that I’m relatively new both to C++ and to
developing on Unix-like system, so this compiler output has me somewhat
mystified. I’ve deciphered that the linker can’t resolve the SDL functions
referenced in the object file dropped by the compiler, but that doesn’t leave me
much the wiser regarding what to do about it. I’ve re-copied SDL.framework to
/Library/Frameworks/ from the distribution .dmg with no success, so I’m guessing
there’s something obvious I need to tell the linker… but what?
Could someone shed some light? I’d appreciate it.
Z