title: Problems Compiling with SDL2 in C
body: <p>Ive been trying to compile a simple program in order to test SDL2 but for some reason when I try to do it the compiler says that the SDL_Window is an unkown type.  I would appreciate it if someone could tell me what im doing wrong.(My operating system is Ubuntu linux) Here is the full output:</p>
  
  <pre><code>thin.c: In function ‘main’:
  thin.c:9:5: error: unknown type name ‘SDL_Window’
       SDL_Window *window;                    // Declare a pointer
       ^
  thin.c:14:5: warning: implicit declaration of function ‘SDL_CreateWindow’ [-Wimplicit-function-declaration]
       window = SDL_CreateWindow(
       ^
  thin.c:16:9: error: ‘SDL_WINDOWPOS_UNDEFINED’ undeclared (first use in this function)
           SDL_WINDOWPOS_UNDEFINED,           // initial x position
           ^
  thin.c:16:9: note: each undeclared identifier is reported only once for each function it appears in
  thin.c:20:9: error: ‘SDL_WINDOW_OPENGL’ undeclared (first use in this function)
           SDL_WINDOW_OPENGL                  // flags - see below
           ^
  thin.c:35:5: warning: implicit declaration of function ‘SDL_DestroyWindow’ [-Wimplicit-function-declaration]
       SDL_DestroyWindow(window);
  </code></pre>
  
  <p>Here is also the source code. Its from the API documentation:</p>
  
  <pre><code>// Example program:
  // Using SDL2 to create an application window
  
  #include "SDL/SDL.h"
  #include &lt;stdio.h&gt;
  
  int main(int argc, char* argv[]) {
  
      SDL_Window *window;                    // Declare a pointer
  
      SDL_Init(SDL_INIT_VIDEO);              // Initialize SDL2
  
      // Create an application window with the following settings:
      window = SDL_CreateWindow(
          "An SDL2 window",                  // window title
          SDL_WINDOWPOS_UNDEFINED,           // initial x position
          SDL_WINDOWPOS_UNDEFINED,           // initial y position
          640,                               // width, in pixels
          480,                               // height, in pixels
          SDL_WINDOW_OPENGL                  // flags - see below
      );
  
      // Check that the window was successfully created
      if (window == NULL) {
          // In the case that the window could not be made...
          printf("Could not create window: %s\n", SDL_GetError());
          return 1;
      }
  
      // The window is open: could enter program loop here (see SDL_PollEvent())
  
      SDL_Delay(3000);  // Pause execution for 3000 milliseconds, for example
  
      // Close and destroy the window
      SDL_DestroyWindow(window);
  
      // Clean up
      SDL_Quit();
      return 0;
  }
  </code></pre>
  
  <p>finally here is the command i issued to compile the code: </p>
  
  <pre><code>gcc thin.c -o test -Wall -lSDL2
  </code></pre>
  
  <p>Thank you</p>