Building an SDL 1.3 application on Mac with g++

Hi, I am developing an SDL app to be cross platform, so I need to compile my app using g++.
I had read that 1.3 (on a mac) does not require the inclusion of the SDLMain.m file. I am trying to get a simple test app to build, but sdl_main.h is still redefining my main() to be SDL_Main like in 1.2.
Is it possible on SDL 1.3 to build an application without the need for SDLMain.m and my main() being redefined to be SDL_Main()?

thanks!

Well, it turns out I was linking against the 1.2 SDL framework rather than the 1.3 SDL framework.
Silly me.
So for anyone who wants to use the 1.3 version of SDL on mac, the SDLMain.m file is apparently not needed anymore.
I did have to do a hack and go into SDL_main.h in the Header directory and comment out the line:
#define main SDL_Main.
This is apparently not needed anymore on mac, but it is still in the header. Without commenting this out, you will get a missing _main link error. I would assume this line will be removed at some point from the header.

and
Here is a sample command line compile and link on the mac for anyone interested.

g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "…/main.cpp"
g++ -framework Cocoa -framework OpenGL -framework SDL -o “SDLTest” ./main.o

cheers

You could just add #undef main after #include “SDL.h”.On 11 May 2010 17:43, bigfoot811 wrote:

I did have to do a hack and go into SDL_main.h in the Header directory and
comment out the line:
#define main SDL_Main.