[Mac OS X] Migrating an existing project to SDL => > includepaths


A few weeks ago, id Software Open Sourced Quake 3: Arena. We at the
Q3Base project have forked Quake 3: Arena and are adding a lot of SDL
replacement code (texture loading through SDL_image, networking through
SDL_net, etc).

Because Quake 3 also runs on Mac OS X, we also have an OS X port to
maintain. I’ve opened the Xcode project made by id Software on my
PowerBook and added all the needed frameworks to my project, but I still
have a problem related to includepaths.

At the top of one of the SDL-ified files, I have this line:

| #include <SDL_net.h>

For some reason, Xcode can’t find this file. This works though:

| #include <SDL_net/SDL_net.h>

Because SDL_net.h includes some other files, this still breaks our

I’ve already tried to add the directory with the header files to our
includepath, but it still doesn’t work.

Is there a known fix for this problem?


Ed Schouten

If you check the SDL FAQ, it says you should do like:
#include “SDL_net.h”
(no angle brackets or paths)

I’m assuming you’re using the framework version and not a traditional
unix style version of SDL based on your comment.

With the Framework version, I know why #include <SDL_net/SDL_net.h>
works for you, and this is related to things Apple (NextStep) has
organized things. You don’t need to set include paths explcitily for
this method if you put the framework in the correct place. But for
portibility (as you have already expressed as a concern) you shouldn’t
do this.

But once you do #include “SDL_net.h”, it should just be a matter of
setting up your include paths. Make sure you do explicitly setup the
paths in the project settings. I would recommend you paste these into
your include path setting (each location is separated by a space):

(Ultimately, these just get passed down to gcc with a -I flag in front
of each). These paths presume you actually placed your frameworks in a
correct location. There is redundancy in the line I just provided so
you can place frameworks in alternative places. Also notice that I
have to list both SDL_net and SDL since they are located in separate
places. If you have other dependencies, you must list those as well.
If you are using a traditional unix style distribution, you need to
change the paths to where ever those are located (e.g.

-Eric> Date: Sun, 11 Sep 2005 13:27:24 +0200

From: Ed Schouten