XCode, SDL...how to make it work

Legie
Unregistered
 
Post: #1
hey,
probably I am going to annoy most of you with my question's trviality, but well...I am just starting... Wink

I would like to use Xcode and SDL, it's as easy as that, but I can't make it work. As I have just started to use a Mac at all, I am quite generally confused with all these stuff. So please, if someone of you has a couple of minutes to explain "everything" to me.

I started with installing sdl 1.2.7-1 via fink. Now I have a bunch of sdl headerfiles in /sw/include/SDL for example, but no sdl.frameworks file. I thought I need that. I thought it works like this, that I will get a .frameworks file that I will add to my normal C-project, like it is with OpenGL, not?
Right now, I completly don't know how to make this work...does anyone know a good tutorial for sdl and mac/xcode or could anyone explain to me how this all functions?

Thanks a lot,
Lena Huh
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
To get the framework, you will need to go to the SDL website and download it. The version you will get there is slightly outdated but perfectly fine until you know enough build your own.
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #3
The SDL Frameworks installer will also install a few Xcode project templates, so you'll get going in no time Wink .
Quote this message in a reply
Legie
Unregistered
 
Post: #4
hey,
thanks for that information. I have the sdl.frameworks now. But I still can't make it work, it's sad...

After I started a new project in XCode and added the sdl.frameworks to it, want to include sdl.h, I get the error "SDL.h: No such file or directory". As the sdl.frameworks is at /Library/Frameworks/SDL.framework and not like all others at /System/Library/Frameworks (why by the way?) I thought I have to define a new paths to the framework, but I couldn't find anything to do that.

Any ideas?
thanks a lot!
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #5
To include the SDL header, you must use <SDL/SDL.h> not "SDL.h" like most examples have it.
Quote this message in a reply
Moderator
Posts: 698
Joined: 2002.04
Post: #6
If you're using any of the Xcode templates provided with the SDL package, then the error is probably caused by the #include "SDL.h" in the SDLMain.h file; that hasn't been fixed in the latest version Huh

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Legie
Unregistered
 
Post: #7
It does work now...unbelivable!...

thanks
Grin
Quote this message in a reply
kraahl
Unregistered
 
Post: #8
I´m having problems as well, I´m new to SDL as well as mac programming (returning mac user)
I downloaded the OS X developer libraries and installed them, from the new project dialog I choose SDL Application, the resulting project fails to compile even though I changed "SDL.h" to <SDL/SDL.h> in the SDLMain-file
Quote this message in a reply
Moderator
Posts: 698
Joined: 2002.04
Post: #9
What error is thrown by Xcode?

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
kraahl
Unregistered
 
Post: #10
SDL/SDL.h: No such file or directory
error: SDL_Event undeclared
error: parse error before "event"
error: 'event' undeclared
error: 'SDL_QUIT undeclared

I had to copy this by hand, so it´s not identical to what I get. It should give you the idea though... if you need more detail, I´ll provide that.
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #11
do you have the SDL framework in the project?

It's not magic, it's Ruby.
Quote this message in a reply
kraahl
Unregistered
 
Post: #12
I have nothing but the files and the frameworks I get from choosing "SDL Application" when I created the project...
So I guess that means no SDL framework...

No such files seem to have been installed though... Is it not included in the package over att libsdl.org?
Quote this message in a reply
Legie
Unregistered
 
Post: #13
hey,
make sure that you have the developer installer ( http://www.libsdl.org "MacOS X: SDL-devel-1.2.8.pkg.tar.gz (Project Builder + XCode)")

Lena
Quote this message in a reply
kraahl
Unregistered
 
Post: #14
Yes, that´s the one I´ve got.

However, the enclosed Readme (Readme SDL Developer.txt) lists
-SDL framework as something that was not installed and available in the SDL source code. Do I need to compile that from source?
Quote this message in a reply
criot
Unregistered
 
Post: #15
im really really new to sdl and im having that same problem...im running xcode 2.2 in tiger. all im trying to do is compile and build the "sdl application" but i have all the above problems i tried swtiching it to <SDL/SDL.h> and it stil di not not work have you guys figured it out yet??

p.s. im using the "complete" package off the sdl site. the one that is non-source (im not sure whta term to use for it Blush Huh )

p.s.s. is there any mac specific tutorials for c or c++ or sdl? (sorry for the unknowingness of the question)
Quote this message in a reply
Post Reply