Quantcast
Channel: Having trouble using SDL framework on XCode - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Swift Dev Journal for Having trouble using SDL framework on XCode

$
0
0

I see three possible problems. The first problem is how you're including SDL.h in your code. You should include SDL.h with the following code:

#include "SDL.h"

The second possible problem is you haven't added the files SDLMain.h and SDLMain.m to your project. Those files are necessary to compile SDL code on Mac OS X. The files are in the devel-lite folder on the SDL disk image.

The third possible problem is that your project doesn't link to the Cocoa framework. The Mac version of SDL uses Cocoa so you need the Cocoa framework in your project.

The following article walks you through the setup of an Xcode 4 project for SDL:

Using SDL with Xcode 4

UPDATE

I noticed a possible problem in how you defined the main() function. You have a space between char and * and another space between * and argv, which could be causing the error. The main() function in my SDL code is defined in the following way:

int main(int argc, char *argv[])

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>