title: SDL2 and SDL_image, Redefinition and Conflicting Declaration When Compiling
body: <p>I am trying to use the <code>SDL_image</code> library so I can display a <code>.png</code> file in a window made using <code>SDL2</code> library.
  My problem is when ever I compile the code I get a lot of errors of about deceleration and stuff in the SDL header files. I'm using Eclipse on Ubuntu LTS 16.04</p>
  
  <p>I am not entirely sure of what the problem is and how I can solve this so a step by step of what, why and how so I can fully understand it would be 
  great</p>
  
  <p>Answer to question is in comments of this post.</p>
  
  <p>Here are my Errors</p>
  
  <pre><code>In file included from /usr/include/SDL2/SDL.h:52:0,
                   from /usr/include/SDL2/SDL_image.h:27,
                   from temp.cpp:12:
  /usr/include/SDL2/SDL_render.h:116:3: error: conflicting declaration 
  ‘typedef enum SDL_RendererFlip SDL_RendererFlip’
   } SDL_RendererFlip;
     ^
  In file included from /usr/local/include/SDL2/SDL.h:52:0,
                   from temp.cpp:11:
  /usr/local/include/SDL2/SDL_render.h:116:3: note: previous declaration 
  as 
  ‘typedef enum SDL_RendererFlip SDL_RendererFlip’
   } SDL_RendererFlip;
     ^
  In file included from /usr/include/SDL2/SDL.h:57:0,
                   from /usr/include/SDL2/SDL_image.h:27,
                   from temp.cpp:12:
  /usr/include/SDL2/SDL_version.h:51:16: error: redefinition of ‘struct 
  SDL_version’
   typedef struct SDL_version
  </code></pre>
  
  <p>`</p>
  
  <p>Here is my code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;SDL2/SDL.h&gt;
  #include &lt;SDL2/SDL_image.h&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  int main(int argc, char* argv[])
  {
      SDL_Window* window;         
      SDL_Renderer* renderer;     
      SDL_Surface* surface;       
      SDL_Texture* texture;       
      SDL_Init(SDL_INIT_VIDEO);   
      IMG_Init(IMG_INIT_JPG);     
  
  
      window = SDL_CreateWindow(  
              "SDL Window",       
              100,                
              600,                
              1200,               
              700,            
              SDL_WINDOW_OPENGL); 
  
      if (window == NULL)         
      {
          cout &lt;&lt; "Could not create window: \n" &lt;&lt; SDL_GetError() &lt;&lt; 
          endl;   
          return 1;                                               
      }
  
      renderer = SDL_CreateRenderer (window, -1, 0);          
  
      surface = IMG_Load("introtext.png");                    
      texture = SDL_CreateTextureFromSurface(renderer, surface);      
      SDL_RenderCopy(renderer, texture, NULL, NULL);              
      SDL_RenderPresent(renderer);
  
      SDL_Delay(5000);                
  
  
      SDL_DestroyTexture(texture);
      SDL_FreeSurface(surface);   
      SDL_DestroyRenderer(renderer);
      SDL_DestroyWindow(window);      
  
      IMG_Quit();                     
      SDL_Quit();                     
      return 0;                       
  }
  </code></pre>