Help with using SDL platform on C++ Error ?

Hello! I'd really appreciate if someone could help me. Im using SDL for the first time and I do not know where I messed up because I followed a tutorial, however I keep getting this error: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? If someone could please tell me how to fix this?

This is my code:
#include "stdafx.h"
#include <SDL.h>
#include "stdio.h"

const int SCREEN_WIDTH = 720;
const int SCREEN_HEIGHT = 480;

bool Initialize();
void Close();

SDL_Window* window = NULL;
SDL_Surface* screen = NULL;

int main ( int argc, char* args[])

{
if (!Initialize())
{
printf ("could not initialize" ) ;
return -1;
}
bool exit = false;
SDL_Event e;
Uint32 bgColor = SDL_MapRGB(screen->format, 0 , 0 , 0);

while (!exit)
{
while (SDL_PollEvent(&e) !=0)
{
if (e.type == SDL_QUIT || e.key.keysym.sym==SDLK_ESCAPE)
exit = true;
}
SDL_FillRect(screen, NULL , bgColor);

SDL_UpdateWindowSurface(window);
}
Close ();
return 0 ;

}

bool Initialize()
{
if( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
printf("SDL could not be initialized! SDL_Error: %s\n" , SDL_GetError());
return false;

}

window = SDL_CreateWindow ("My SDL Game",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);

if (window == NULL)
{
printf ("Window could not be creatd! SDL" , SDL_GetError());
return false;
}
screen = SDL_GetWindowSurface(window);
return true;
}



void Close()
{
SDL_DestroyWindow(window);
window = NULL;

SDL_Quit();
}
Disable the precompiled header option in Project Options.
Topic archived. No new replies allowed.