Hello,
I have unsuccessfully tried to create SDL applications on Mac OS X since quite some time. No problem with Windows and GNU/Linux (well, almost). Being a complete novice on Mac OS X development probably doesn't help
I have tried to compile the following code:
I use the following command to compile it: g++ -g -framework SDL -framework Cocoa test.cpp -o test
I have also used various combinations of the following options: -lSDL -L/Library/Frameworks/SDL.framework/Versions/Current -D_REENTRANT -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/default
I have also tried to use with and without the file SDLMain_tmpl.m (my example is with, errors are different without it) .
It compiles without problem, but fails at linking with the following errors:
Thanks in advance
I have unsuccessfully tried to create SDL applications on Mac OS X since quite some time. No problem with Windows and GNU/Linux (well, almost). Being a complete novice on Mac OS X development probably doesn't help

I have tried to compile the following code:
Code:
#include <SDL/SDL.h>
int main(int,const char*)
{
if(SDL_Init(SDL_INIT_VIDEO)==0)
{
fprintf(stderr,"SDL initialized.\n");
SDL_Quit();
}
else fprintf(stderr,"Error while initializing SDL.\n");
return 0;
}
I have also used various combinations of the following options: -lSDL -L/Library/Frameworks/SDL.framework/Versions/Current -D_REENTRANT -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/default
I have also tried to use with and without the file SDLMain_tmpl.m (my example is with, errors are different without it) .
It compiles without problem, but fails at linking with the following errors:
Do someone has an idea on what's going on? And yes, I checked that SDL is correctly installed, but since I am novice in Mac OS X, I may be wrong.ld: Undefined symbols:
_SDL_free
_SDL_main
_SDL_malloc
_SDL_strlcpy
_SDL_strlen
Thanks in advance
