SDL problem

Apprentice
Posts: 17
Joined: 2007.02
Post: #1
It seems like everyone is having a problem like this, anyway...

I downloaded SDL and put the framework and template files where they belong. So I created a new SDL OpenGL app, changed all instances of "SDL.h" to "SDL/SDL.h", removed the nonworking SDL framework connection and replaced it with a working one. Now I'm getting 5 errors because of this one error I'm getting saying "error: SDL/SDL.h no such directory". I have absolutly no idea why its doing this.
Quote this message in a reply
Apprentice
Posts: 19
Joined: 2007.03
Post: #2
try saying <SDL/SDL.h>. the "<" and ">" tell the compiler to search for that file. When you put it in qoutes, it's a literal path relative to your project. That's why its not finding it.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2007.02
Post: #3
I'll remember that in the future, but it didn't work...
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #4
If you created an SDL project from the template and it doesn't build, maybe something went wrong with your SDL installation. Every time I've done it, you can just build it straight away with no complaints.

If you do want to use SDL from somewhere else, maybe you need to add it to your header search paths or framework search paths. Have a look in the build settings.
Quote this message in a reply
Moderator
Posts: 133
Joined: 2008.05
Post: #5
To reiterate what maximile said and to clarify exactly what he means, the compiler cannot find your SDL.h file because it doesn't know where to look. In your build settings for a project, you can specify where to find certain things such as header files, libraries and frameworks. AFAIK, regardless of what is entered in these settings, XCode will always search /System/Library/Frameworks, as it is where nearly all of the Apple supplied frameworks are. If the SDL.framework did not install to this location, you can drag it there and have it work. Or you can find where it was installed(Possibly /Library/Frameworks, as some 3rd party frameworks default there) and add that path to your build settings.

I am not familiar with SDL, but if you have built the framework properly it should be somewhere on your computer, and it's only a matter of telling the compiler where it is.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2007.02
Post: #6
Thanks for explaining it too me, it's found the file, but now I'm getting one last error: "Command /usr/bin/gcc-4.0 failed with exit code 1"
Quote this message in a reply
Post Reply