Unresolved external symbol _SDL_main

Good day.
I want to know why i receive that error when compile C++ program using SDL:

SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external symbol
_SDL
_main referenced in function _main–
Regards,
Igor Mironchick,
Intervale ©
#ICQ 492-597-570

Are you linking your SDL.LIB into your project?–
Lilith

On 1/20/2007 at 7:39 AM, “Igor Mironchick” wrote:
Good day.
I want to know why i receive that error when compile C++ program
using SDL:

SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external
symbol
_SDL
_main referenced in function _main

I want to know why i receive that error when compile C++ program using SDL:

SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external
symbol _SDL
_main referenced in function _main

#include “SDL.h” in the file with your main() function…on Windows, it
will #define main to be SDL_main, which gets called from the WinMain()
in SDLmain.lib.

Alternately, define your own WinMain() and don’t use SDLmain.lib.

–ryan.

Thx for yours reply. I found problem.–
Regards,
Igor Mironchick,
Intervale ©
#ICQ 492-597-570

El S?bado, 20 de Enero de 2007 18:06, Ryan C. Gordon escribi?:

I want to know why i receive that error when compile C++ program using
SDL:

SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external
symbol _SDL
_main referenced in function _main

#include “SDL.h” in the file with your main() function…on Windows, it
will #define main to be SDL_main, which gets called from the WinMain()
in SDLmain.lib.

On Windows, I have also found that declaring main as

int main()

won’t do. Your “main” function should be defined as

int main(int argc, char *argv[])

Just my 2 cents :slight_smile: