Compiling an sdl app with makefile -- can't find header

I’m trying to compile an sdl app with a makefile on Panther. I installed the OS X sdl packages from the libsdl site.

A. Where’s sdl-config? Do I need it on OS X?

B. When I try to build, my compiler complains that it can’t find the sdl header I’m asking for:

g++ -c main.cpp
In file included from main.cpp:3:
Game.hpp:6:30: SDL/SDL_keyboard.h: Not a directory
In file included from main.cpp:3:
Game.hpp:41: error: `SDL_keysym’ was not declared in this scope

What arg am I supposed to pass in with the “-I” g++ option?

Ack! Sorry. I simply had to really spell-it-out

-I/Users/john/Library/Frameworks/SDL.framework/Versions/A/Headers

then change every ‘#include <SDL/SDL_foo.h>’ to ‘#include <SDL_foo.h>’.

Now,… the fact that my little program builds but doesn’t run, and that I’m supposed to have some “SDLMain.m” file somewhere, is a horse of a different color.

If someone knows of a faq or help doc anywhere that tells explicitly how to port to OS X, please post. It’s probably something simple, like changing a filename .cpp–>.mm and adding a linker flag, but a link or info would still be very nice (I’m compiling this on OS X for a friend and know very little about developing on OS X).

Oh, also – evidently, sdl-config only comes with the source code package, not the binary or dev packages.

[This message has been edited by jmg (edited 02-22-2004).]

If all your includes are of the form <SDL/foo.h>, you should leave them in that form and use the -F flag to specify the directory that contains the framework.

SDLMain.h and .m come with the source package I know, but they should also come with the developer package. If you can’t find them (and they might be in the Project Builder / Xcode templates folder somewhere), look for a libSDLMain.a instead.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.