[SDL] SDL on Mac OS X

Richard Schreyer rws_list at girr.org
Thu Jan 27 10:01:43 PST 2005

Not quite.

What you're actually looking at are two different library types, 
Framework vs. dylib (mac os x name for a .so).  Essentially, the Mac OS 
X concept of a shared lib vs the unix concept.  Both are usable, and 
they will both get you the same functioanlity (ie, native window system).

The dylib/so approach will be most familiar to those from a unix 
background.  Put the the sdl dylib in /usr/lib (or /sw/lib if you are 
using fink, as you should be).  Headers are put in /usr/include/SDL (or 
/sw/include/SDL).  You get these downloading the SDL sources and doing a 
configure/make, or using fink.  sdl-config will then be available.

By downloading the Mac OS X dev packages, you got the frameworks. 
Frameworks are a directory (named foo.framework), that contain not only 
the dylib, but also all the headers, and other supporting files. 
Everything related to the framework comes in a single folder, rather 
than scattering files between /usr/lib, bin, include, share, etc.  The 
frameworks do not include sdl-config, because it is unnecessary.

There was recently a discussion about which is best.  I'm just going to 
say go with the Frameworks.  When redistributing your app, place the SDL 
and SDL_image frameworks in YourAppBundle.app/Contents/Frameworks.

As for getting SDL_image and SDL_mixer to work, you'll need frameworks 
for those too.  If binaries are not available, then you can build them 
yourself using xcode.  In the SDL_image,mixer,ttf source distributions, 
there is a file, PBProjects.tar.gz, which contains xcode projects to 
create these.  Place them in ~/Library/Frameworks for ease of 
development, and then put them in AppBundle.app/Contents/Frameworks when 
redistributing your binary.

Richard Schreyer

Chris Nystrom wrote:
> I am one of those guys that bought a Mac mini, to give OS X a whirl.
> So far I am very impressed. However I have an SDL question:
> I downloaded and installed the SDL and SDL development packages for
> Mac OS X that integrate with Xcode. Cool so far, but then I went to
> install some of the libraries such as SDL_image, SDL_mixer, SDL_ttf,
> etc. There were no pre-bult packages, so I thought I would just build
> them. However, there does not appear to be an sdl-config script, so
> the packages fail.
> So it seems like there are 2 paths for SDL development on the OS X platform:
> 1. Native Xcode: integrates well with OS X, but no libraries.
> 2. X11 mode: have libraries, but user must have X11 installed.
> Is my understanding of the situation correct?
> Thank you,
> Chris

More information about the SDL mailing list