Wiki Page Content

FAQ: Mac OS X

What is supported?

SDL supports Mac OS X 10.4 and newer, using either Xcode or the classic UNIX style build system. Currently only Xcode can be used to build the SDL Framework. The UNIX build system creates classic shared and static versions of the SDL library.

For the latest information see http://hg.libsdl.org/SDL/file/default/README-platforms.txt

What is the difference between the Xcode and the UNIX style build system?

The SDL-devel package contains the SDL libraries in the form of a Framework. That is perfectly fine as long as you want to develop using Xcode. However, applications which use a configure script almost always require SDL to be installed UNIX style.

When installed as a Framework, all SDL files (the library and the header files) are aggregated into a .framework bundle, and installed together into /Library/Frameworks/ or ~/Library/Frameworks/. There, Xcode can find it. But packages which want to use SDL but employ a UNIX style build system are usually not able to find SDL there (there are a few exceptions where people hand modified their configure scripts to allow using Frameworks on OS X, but those are rare).

When installing UNIX style, SDL gets installed into /usr/local/bin, /usr/local/include and /usr/local/lib (the exact path can vary, for example the Fink SDL package will use /sw instead of /usr/local by default). This way, build system tuned to support generic UNIX systems are able to find them.

How do I install SDL UNIX style?

Either you can compile and install it from source (via the usual ./configure && make && make install procedure). Or install it via some kind of packaging system which ships premade packages for SDL. For example, both Fink and MacPorts include packages which are suitable. You can learn more about them on their respective sites.

Note that as long as you static link the release builds of your application, it doesn't really matter which way you installed SDL -- for example, even if you installed it via Fink, if you static link SDL, your users do not have to install Fink.

How do I build an OpenGL application?

On Mac OS X, you access the OpenGL headers like so:

#include <OpenGL/gl.h> #include <OpenGL/glext.h>

The header file "SDL_opengl.h" includes these headers on all supported SDL systems.

If you are using Xcode, add OpenGL.framework to your project. On the command line, add:

-framework OpenGL

to the GCC or LD arguments in your Makefile

How do I include the SDL framework in my application?

One good strategy can be found here: Properly bundling .frameworks in your application package

None: FAQMacOSX (last edited 2013-09-16 19:10:54 by PhilippWiesemann)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit