Original Post
I have no idea why this won't compile, I keep getting an error around line 20. My libraries are set up correctly, and I'm using Dev-C++ beta 5. Here's the code: And here are the errors I keep getting: C:\Dev-Cpp\SDL_framwork\main.cpp In function
#include <cstdlib> // for the atexit() function
#include "SDL\SDL.h" // SDL header
// define our screen size constants if not going to use fullscreen
#define SCREEN_WIDTH 800;
#define SCREEN_HEIGHT 640;
int main(int argc, char **argv)
{
// init SDL
if(SDL_Init(SDL_INIT_VIDEO)<0)
{
printf("Unable to init SDL: %s\n", SDL_GetError());
return 1;
}
atexit(SDL_Quit);
// set up the video mode
SDL_Surface *screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 32, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
if (screen == NULL)
{
printf("Unable to set video mode: %s\n", SDL_GetError());
return 1;
}
// set up the window caption
SDL_WM_SetCaption("SDL Framework", NULL);
SDL_Event event;
bool gameRunning = true;
while (gameRunning)
{
if (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
gameRunning = false;
break;
case SDL_KEYDOWN:
{
switch (event.key.keysym.sym)
{
case SDLK_ESCAPE:
gameRunning = false;
break;
default: break;
}
default: break;
}
}
return 0;
}
int SDL_main(int, char**)': 20 C:\Dev-Cpp\SDL_framwork\main.cpp expected )' before ';' token 20 C:\Dev-Cpp\SDL_framwork\main.cpp expected primary-expression before ',' token 20 C:\Dev-Cpp\SDL_framwork\main.cpp expected primary-expression before ',' token 20 C:\Dev-Cpp\SDL_framwork\main.cpp expected ;' before ')' token 59 C:\Dev-Cpp\SDL_framwork\main.cpp expected }' at end of input 59 C:\Dev-Cpp\SDL_framwork\main.cpp expected `}' at end of input C:\Dev-Cpp\SDL_framwork\Makefile.win [Build Error] [main.o] Error 1 I've been staring at this so long trying to figure out what's wrong that my eyes are getting crossed and blurry! Any help would be appreciated