# error: expected ',' or ';' before "int"



## Heavy Rain (Jan 6, 2010)

Hi, I can't get this SDL program to run for some reason, it always states the above error when I try to run this program and I can't find a solution on Google or by reading about it on other forums and stuff,

This is my code:


```
#include "SDL/SDL.h"

SDL_Surface* screen = NULL

int main(argc, char**)
{
    //Initialize SDL
    if(SDL_Init(SDL_INIT_EVERYTHING) == true)
    {
        return 1;
    }
    //Setup the screen
    Screen = SDL_SetVideoMode(640, 320, 32 SDL_SWSURFACE);
    //If there was ana error starting up the screen
    If(screen == Null)
    {
        return 2
    }
    //Set the window caption
    SDL_WM_SetCaption("SDL Project", NULL);

    //Game loop
    SDL_Event even;
    bool isRunning = true;
    while (isRunning)
    {
        while   (SDL_PollEvent(&event))
        {
            if (event.type == SDL_QUIT)
            {
                isRunning = false;
            }
        }
        //Draws the background color
        SDL_FillRect(screen, &screen->clip_rect, SDL_MapRGB(screen->format, 0xFF, 0xFF, 0xFF));
    SDL_Flip(screen);
    }

    //Quit SDL
    SDL_Quit();
    return 0;
}
```
And when I do put a ';' before int (after NULL) I get 8 more errors: 


```
E:\Self Destruct\Files\Downloaded\lol\SDL\SDL\main.cpp|5|error: `int SDL_main' redeclared as different kind of symbol|
E:\Self Destruct\Files\Downloaded\lol\SDL-devel-1.2.14-mingw32\SDL-1.2.14\include\SDL\SDL_main.h|57|error: previous declaration of `int SDL_main(int, char**)'|
E:\Self Destruct\Files\Downloaded\lol\SDL\SDL\main.cpp|5|error: declaration of `int SDL_main'|
E:\Self Destruct\Files\Downloaded\lol\SDL-devel-1.2.14-mingw32\SDL-1.2.14\include\SDL\SDL_main.h|57|error: conflicts with previous declaration `int SDL_main(int, char**)'|
E:\Self Destruct\Files\Downloaded\lol\SDL\SDL\main.cpp|5|error: `argc' was not declared in this scope|
E:\Self Destruct\Files\Downloaded\lol\SDL\SDL\main.cpp|5|error: expected primary-expression before "char"|
E:\Self Destruct\Files\Downloaded\lol\SDL\SDL\main.cpp|6|error: initializer expression list treated as compound expression|
E:\Self Destruct\Files\Downloaded\lol\SDL\SDL\main.cpp|6|error: expected `,' or `;' before '{' token|
||=== Build finished: 8 errors, 0 warnings ===|
```
And I put a ',' before int I got:


```
E:\Self Destruct\Files\Downloaded\lol\SDL\SDL\main.cpp|5|error: expected unqualified-id before "int"|
||=== Build finished: 1 errors, 0 warnings ===|
```
I know I am a noob and this is probably an easy to solve problem for you guys and that's why I'm here, my IDE is CodeBlocks and am on Win XP.


----------

