I'm trying to compile some code from a book, I have set all the correct linker and compiler options for SDL libs and headers. But I get this error:
LINK : fatal error LNK1561: entry point must be defined
This is my code:
Code:
#include <SDL.h>
int main (int argc, char* argv[]) {
if (SDL_Init( SDL_INIT_VIDEO ) < 0)
return -1;
SDL_WM_SetCaption("Hello World", "Hello World");
SDL_Surface* screen = SDL_SetVideoMode(640,480, 0, 0);
SDL_Surface* temp = SDL_LoadBMP("data\\textures\\sdl_logo.bmp");
SDL_Surface* bg = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
SDL_Event event;
bool quit = false;
while (!quit)
{
if (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
quit = true;
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym)
{
case SDLK_ESCAPE:
quit = true;
break;
}
break;
}
}
SDL_BlitSurface(bg, NULL, screen, NULL);
SDL_UpdateRect(screen, 0, 0, 0, 0);
}
SDL_FreeSurface (bg);
SDL_Quit();
return 0;
}