[SDL] Dev C++ Linking Issues

Tyler Montbriand tsm at accesscomm.ca
Thu Sep 29 20:45:54 PDT 2005

On September 29, 2005 08:56 pm, Mike Frysinger wrote:
> this must be a VC++ thing then because linux doesnt require either of these
SDL_main is there to convert things like:

  int WinMain(HINSTANCE hInse, HINSTANCE hPrev,LPSTR lpCmdLine,int nCmdShow)
  int main(int argc, char *argv[])

As well as do initialization that MUST be done before main is called, such as 
the crazyass MacOS X carbon/cocoa/aqua/name-of-the-week stuff.  It's a bit 
convoluted.  The "main"-equivalent that gets called first is inside 
-lsdlmain, which in turn calls *your* main, which may have been renamed to 
SDL_main with a preprocessor definition.

linux, and UNIX in general, doesn't need need an -lSDLmain -- they have a 
standards-compliant int main(int argc, char *argv[]) interface already and 
don't have crazyass stuff to be initialized before main.  Hence, no 
overloading, and hence, no picky -lsdlmain to bitch about your main not being 
the right type of function.

More information about the SDL mailing list