Error with Release mode build: Zerolink?

hey, I'm working in Xcode and I tried to do a release mode build of my game engine (which compiles just fine in debug mode) and it doesn't compile and gives the error:

/usr/bin/ld: warning multiple definitions of symbol _main

i've traced the problem to be Zerolink, turned off by default in release mode. The program compiles just fine with this turned on. Can someone tell me exactly what Zerolink is and why it might be causing this problem?

Zerolink links the symbols at runtime as the program needs them rather than at compile time. It also won't let your programs be run anywhere but on your own computer. If you have multiple definitions of main, it could mean you accidentally defined main somewhere else and have forgotten about it, or it could also mean that you're including source files rather than just .h files. Or it could also mean that you have defined main in a .h file that's included into multiple files, or that your project somehow is set up to compile some files twice. (including the one with main in it) Without more information, it's impossible (for us, at least) to determine what possibility it is.

ok so I got it to compile at least, but the duplication of main warning is because the standard SDL OpenGL template has 2 different main methods. I had just copied this verbatim and added my own code but since I changed the "main.c" file given in the template to a "main.cpp" file I have gotten these warnings. I'm a cocoa noob but I've poked around in the SDLmain.m file given with these templates and I can't figure out to get the warning to go away. I can't rename either of the main methods without it breaking.

Is there any way to fix this or will I just have to encapsulate my C++ code and change my main.cpp file to main.c?

SDLMain.m contains it's own main function, which then in turn calls your own main function. However, in order to get it to work, you must include <SDL/SDL.h> (or at the very least SDLMain.h) in your main.cpp file, since it uses the pre-processor to re-name your main function to SDL_main, which is what's called from SDL's main function. So, in short, just add #include <SDL/SDL.h> to main.cpp.