   Segmentation Error - OPENGL/SDL
  I keep getting segmentation error with the following source (it is not mine it was an example I found and was using to make sure i set it up properly but cant see the error) - First time using SDL with OpenGL so a tutorial would also help.#include "SDL/SDL.h"#include "GL/gl.h"int main(int argc, char *argv[]){   SDL_Event event;   float theta = 0.0f;   SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );   SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );   SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE,8 );   SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32 );   SDL_Init(SDL_INIT_VIDEO);   SDL_SetVideoMode(600, 300, 0, SDL_OPENGL);   glViewport(0, 0, 600, 300);   glClearColor(0.0f, 0.0f, 0.0f, 0.0f);   glClearDepth(1.0);   glDepthFunc(GL_LESS);   glEnable(GL_DEPTH_TEST);   glShadeModel(GL_SMOOTH);   glMatrixMode(GL_PROJECTION);   int done = 0;   while(done == 0)   {glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glLoadIdentity();glTranslatef(0.0f,0.0f,0.0f);glRotatef(theta, 0.0f, 0.0f, 1.0f);glBegin(GL_POLYGON);glColor3f(1.0f, 0.0f, 0.0f);glVertex2f(0.0f, 1.0f);glColor3f(0.0f, 1.0f, 0.0f);glVertex2f(0.87f, -0.5f);glColor3f(0.0f, 0.0f, 1.0f);glVertex2f(-0.87f, -0.5f);glEnd();theta += .5f;SDL_GL_SwapBuffers();SDL_PollEvent(&event);if(event.key.keysym.sym == SDLK_ESCAPE)  done = 1;   }   SDL_Quit();   return 0;}thanks Catkill   