SDL question


Unfortunately, I couldn’t find any forum related to SDL so I decided to post here.
The question is - which develpment library should I download to run SDL applications on W2k? I’ve got one lib for Win32 but every time I try to compile any sample program I get some error related to WinMain@16. Does it mean that I can’t create a console application using SDL?..


There is a SDL newsgroup, you can find a link from the SDL website

under Newsgroup.

SOme time ago, I have tried SDL1.2.6 for VC++6 (, from SDL downloads, development libraries). I did’t have any problems under VC++6 (bliaah…) using project settings from examples and tutorials I found, also from their site.


Originally posted by Orzech:
I get some error related to WinMain@16. Does it mean that I can’t create a console application using SDL?..

No, you must create a windows application; what you have to do is to link additionally to the SDL library called SDLMain.lib or libSDLMain.a or whatever is called for your compiler .


Hi again

I did some digging up of some old code I wrote with SDL under VC++6, a couple of years ago, but the settings etc. should be the same.

I used a Win32 Console Application (NOT a Win32 Application, that is), and then selected to create a ‘Hello World’ application. Above the main function (or indeed wherever you want to stick your SDL code but I assume you’re experimenting so main will do fine ), include <SDL.h>. Then you can add your SDL init code, etc.

In project settings, set the include and lib paths to where you’ve got your SDL header and lib files. And you should be able to build this.

Hope this helps. I remember I spent quite a few nights trying to figure out how to compile an app with SDL.


Great thanks guys! I’ll experiment with all the things you’ve said. Azdo - it is really possible that my problem can be solved be including SDLMain.lib. I have to check it out! madmortigan - i am still thinking about a solution with console application since all the examples that I saw were basically console applications. Hmmm… I am almost 100% sure that I’ve linked all the necessary headers and libraries. I guess that the matter is that I have a developers’ libraries for VC 6.0 and they probably require win32 apps. Although, I searched for some non-OS specific SDL package and I couldn’t find it.

Thanks once again!