Original Post
I have a silly problem when using devcpp(4.9.8.0) with libsdl (from SDL-devel-1.2.7-mingw32.tar.gz). Linker gives me an error message, that I have no WinMain although I'm compiling it as a console program. Does anyone know how to set the devcpp for compiling&linking a code like this:
#include <SDL.h>
int main(int argc, char **argv)
{
SDL_Surface *screen;
bool done=false;
SDL_Event event;
if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
{
fprintf( stderr, "Video initialization failed: %s\n",
SDL_GetError( ) );
SDL_Quit( );
}
screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
if ( screen == NULL )
{
printf("Unable to set 640x480 video: %s\n", SDL_GetError());
SDL_Quit();
return 1;
}
while(!done)
{
while(SDL_PollEvent(&event))
{
if(event.type==SDL_QUIT)done=true;
if(event.type==SDL_KEYDOWN)
{
if ( event.key.keysym.sym == SDLK_ESCAPE ) { done = 1; }
};
};
};
SDL_Quit();
return 0;
};
[edited by - Glubo on June 6, 2004 7:49:01 AM]
