Hello all,
I am working with an iPhone application using the iPhone SDL libraries provided by SDL 1.3. I’m confused as to how to specify to XCode that I want to run my “main” function.
I tried:
#ifdef main
#undef main
#endif
Without doing that, I get conflicts with _SDL_main:
collect2: ld returned 1 exit status
symbol(s) not found
_SDL_main in main.o
"_event_loop", referenced from:
_SDL_main in main.o
"_init_timers", referenced from:
_SDL_main in main.o
"_init_video", referenced from:
where event_loop, init_timers and init_video are functions I have specified in different header files with the code in their respective source files.
If I do put that #ifdef in there, I get the following:
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 failed with exit code 1
duplicate symbol _main in lib/libSDLSimulator.a(SDL_uikitappdelegate.o) and /Users/charlieevans/Documents/KepSiegeGame/build/KepSiegeGame.build/Debug-iphonesimulator/KepSiegeGame.build/Objects-normal/i386/main.o
Now, for a third way, I completely commented out my main function. The error I get (which is different than the ones above) is as follows:
collect2: ld returned 1 exit status
symbol(s) not found
-[SDLUIKitDelegate applicationDidFinishLaunching:] in libSDLSimulator.a(SDL_uikitappdelegate.o)
"_SDL_main", referenced from:
I know this is a long list of different things, but I’m at my wits end here and just cannot figure it out. If someone has some insight into trying something or what I am doing wrong, your help would be great appreciated. Thank you