The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
unresolved external symbol _SDL_main
Igor Mironchick
Guest

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 (c)
#ICQ 492-597-570
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070120/a3a6ae03/attachment.htm
unresolved external symbol _SDL_main
Lilith Calbridge
Guest

Are you linking your SDL.LIB into your project?

--
Lilith

Quote:
Quote:
Quote:
On 1/20/2007 at 7:39 AM, "Igor Mironchick" <imironchick at gmail.com>
wrote:
Quote:
Good day.
I want to know why i receive that error when compile C++ program
using SDL:
Quote:

SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external
symbol
Quote:
_SDL
_main referenced in function _main
unresolved external symbol _SDL_main
Ryan C. Gordon
Guest

Quote:
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.
unresolved external symbol _SDL_main
Igor Mironchick
Guest

Thx for yours reply. I found problem.


--
Regards,
Igor Mironchick,
Intervale (c)
#ICQ 492-597-570
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070120/5556fb51/attachment.htm
unresolved external symbol _SDL_main
Alberto Luaces
Guest

El S?bado, 20 de Enero de 2007 18:06, Ryan C. Gordon escribi?:
Quote:
Quote:
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 Smile