Reputation: 895
How to set up SDL2 with MAC OS X 10.8 and XCode 4.6 or later versions?
I have managed to build SDL2 and assume to have all the files I need. Where should I place my library files and setup XCode project to be able to build and run a simple example?
Upvotes: 4
Views: 2669
Reputation: 2134
SDL2.framework
bundle to /Library/Frameworks
(may require root permissions)codesign -f -s - /Library/Frameworks/SDL2.framework/SDL2
SDL2.framework
. Add it.SDL2.framework
to add.main.c
with the code below:SDL_Init success!
output in the lower pane of Xcode.
#include <SDL2/SDL.h>
int main(int argc, const char * argv[]){
if(SDL_Init(SDL_INIT_EVERYTHING) != 0) {
puts("SDL_Init error");
return -1;
}
else {
puts("SDL_Init success!");
return 0;
}
}
Source: SDL2 on Mavericks OS X
Upvotes: 1