Reputation: 11
I am trying to compile a project with SDL in Xcode and get the error:
Undefined symbols for architecture x86_64:
"_main", referenced from:
-u command line option
I have the SDL.framework include along with Cocoa.framework in the Link Binary with Libraries. I also have SDLMain.h and SDLMain.m in the project.
This is all my code:
#include "SDLMain.h"
#include <SDL/SDL.h>
int main(int argc, const char * argv[])
{
return 0;
}
Upvotes: 0
Views: 159
Reputation: 20125
It tool a quite long time until I got SDL and Xcode running. So, don't care. :-)
I uploaded here a simple SDL template for Xcode 4.5 and Mac OS X 10.7 and 10.8 (also using OpenGL 3.2 Core Profile possible). Step by Step instructions:
SDL.framework
into /Library/Frameworks/
Further details and an image on my Blog (only german, sorry).
Upvotes: 0
Reputation: 11
int main has to look like this:
int main(int argc, char * argv[])
{
return 0;
}
get rid of the const
Upvotes: 1