Does any one here know how to use Simple Direct Media Layer? I need help..

Sorry this topic is a little of base, but I do use OpenGL for all my graphic needs but I am experimenting with SDL for my Input and audio. My question is,why when i compile me project, it goes without a warning or error, but when i attempt to compile/execute my program i get this error message

SDLmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol _SDL_main
Debug/Next step.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I place the dll file in the directory, and add the SDL.lib, and SDLmain.lib files to the active project. And i also initialize my code generation to multithreading dll.
I have other peoples code that will run just fine with this setup, but for some reason my wont. Any suggestions?.?.

Hi !

Posting this at the SDL mailinglist would give you a better answer I think.

I wild guess is that you have missed on some option in the project settings, compare your project settings with one of the examples included with SDL.

Mikael

Just put ‘#undef main’ between your '#include “SDL/SDL.h” and int main()…

This may be an SDL faq:
http://www.libsdl.org/faq/FAQ-Win32.html

Also, make sure you are linking SDL_main BEFORE the SDL library.

  • Mike