I've managed to build SDL2.0 and I got my SDL2.framework folder built. Don't know if I placed it in the correct location on my system. I'm using XCode 4.6 with OS X 10.8. I placed it here /System/Library/Frameworks
When I start a new XCode project I choose Command Line Application. Select to add OpenGL.framework and then I try to add SDL2.framework but it doesn't appear on the search list. I then click on Add Other and manually select SDL2.framework located in /System/Library/Frameworks. I then add some simple SDL code and try to build. I get this error then:
SDL.h file not found
I can see in my XCode project that the SDL2.framework is there and I can expand it o see that SDL.h exists and I can even open it.
What am I missing here?
I normally put my framework in /Library/Frameworks/ but it is up to you where you put it as long as you link it correctly.
If you have added it correctly to your project then it shouldn't cause an issue. You may want to add the Cocoa.framework as well depending on what you are doing.
The most portable way to include for SDL2 is:
#include "SDL.h"
You just need to ensure you have the additional include directories configured in either your IDE or makefile etc accordingly, so that the folder where SDL.h resides is listed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With