Sign in to follow this  
Kath

SDL: iPhone linking issues

Recommended Posts

Kath    142
I'm trying to get our SDL project ported to iPhone. I've checked out the latest SDL, SDL_Image and SDL_Mixer and updated the projects to point at the latest iPhone SDK/Frameworks (the svn ones still point at 2.0). They all compile fine but I'm having some trouble linking them to our app. If I link just the main SDL lib everything links ok apart from the SDL_Image/SDL_Mixer functions we used (as expected). However after adding the SDL_Image/SDL_Mixer libs I built I get more linker errors: Undefined symbols:
 

  "_AudioComponentFindNext", referenced from:
      _prepare_audiounit in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)

 "_kUTTypeBMP", referenced from:
      _kUTTypeBMP$non_lazy_ptr in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_kUTTypeGIF", referenced from:
      _kUTTypeGIF$non_lazy_ptr in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_kUTTypeICO", referenced from:
      _kUTTypeICO$non_lazy_ptr in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_kUTTypePNG", referenced from:
      _kUTTypePNG$non_lazy_ptr in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_kUTTypeJPEG", referenced from:
      _kUTTypeJPEG$non_lazy_ptr in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_AudioUnitInitialize", referenced from:
      _prepare_audiounit in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)

  "_CGContextDrawImage", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_CGColorSpaceRelease", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_kUTTypeTIFF", referenced from:
      _kUTTypeTIFF$non_lazy_ptr in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_CGImageGetHeight", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_CGImageGetWidth", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_CGImageGetAlphaInfo", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_CGContextRelease", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_CGBitmapContextCreate", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

  "_CGColorSpaceCreateDeviceRGB", referenced from:
      _Create_SDL_Surface_From_CGImage in libSDL_image_sim_d.a(IMG_UIImage.o)

 "_AudioUnitSetProperty", referenced from:
      _COREAUDIO_CloseDevice in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)
      _prepare_audiounit in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)
      _prepare_audiounit in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)
      _prepare_audiounit in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)
      _prepare_audiounit in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)

  "_AudioOutputUnitStop", referenced from:
      _COREAUDIO_CloseDevice in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)

  "_AudioOutputUnitStart", referenced from:
      _prepare_audiounit in libSDLSimulator_d.a(SDL_coreaudio_iphone.o)

I'm guessing that I'm not linking something I should when I build the SDL libs but I'm not sure how to fix it. Some searching revealed that the kUTType* stuff is from ApplicationServices.framework but from what I can see that is a OSX only framework and doesn't exist in the iphone sdks. I also noticed that the SDL xcodeprojects all have a "Copy Headers" build step but I couldn't figure out where it copies to. I'm pointing at the headers as I downloaded from SVN e.g. SDL/include. Does this create special iphone headers I should actually be using? Thanks for reading.

Share this post


Link to post
Share on other sites
Palidine    1315
Did you specifically get the SDL for iPhone or are you trying to link against normal SDL for mac? The latter won't work. You can find the former here:
http://code.google.com/p/iphone-sdl-1-3/

I think the setup docs should have instructions (and a couple example projects hopefully). But it looks like, yes you need to add a framework which should hopefully be explained in the iphone-sdl docs

[EDIT: looking more at that project it would appear that the iphone-sdl no longer works with the 3.0+ SDKs. I would recommend the oolong engine; it works nicely]

-me

Share this post


Link to post
Share on other sites
Kath    142
I'm using the latest trunk revision from SVN. All of them have xcode projects and iphone targets. I've fixed the _CG* errors by also linking to CoreGraphics.framework in our game project which brings my linker errors to 12 from 20 [smile]. We're using our own engine with SDL as it lets us create Windows builds for those of us without mac access (most of us).

It looks like linking AudioUnit.framework would fix some of the other linker errors but after adding it to our project and trying to build it reports that it cannot find the framework. I've triple checked the paths I see in the Get Info screen in xcode and the framework does exist. Other linked frameworks like OpenGLES with the same paths link fine. I'm still getting used to xcode so perhaps I've missed a setting somewhere?

Share this post


Link to post
Share on other sites
michelleC    100
check out the iphone posts on the sdl forum, you are also welcome to look at our sdl project.
http://code.google.com/p/ffmpeg4iphone/wiki/WebStreamX

Its a streaming video player, but it has a lot of the libraries you need ie. audiounits.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this