title: Can't load .bmp SDL2 IMG_LoadTexture
body: <p>so I was following <a href="https://www.youtube.com/watch?v=mSOgmiEy3qk" rel="nofollow">this</a> tutorial, and everything was going all smooth and dandy, until I encountered a problem, namely that I couldn't load a .bmp.</p>
  
  <pre><code>#include &lt;SDL2/SDL.h&gt;
  #include &lt;SDL2/SDL_image.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;SDL2/SDL_main.h&gt;
  
  using namespace std;
  
  
  
  int main(int argc, char* argv[]) {
  
  bool quit = false;
  
  SDL_Init(SDL_INIT_VIDEO);
  
  SDL_Window* window;
  
  window = SDL_CreateWindow("window", 100, 100, 1280, 720, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
  
  if(window == NULL){
  
      cout &lt;&lt; "Disn't work, here is why: " &lt;&lt; SDL_GetError()&lt;&lt; endl;
      return 0;
  }
  
  
  SDL_Renderer* renderer = NULL;
  
  renderer= SDL_CreateRenderer(window, -1 ,SDL_RENDERER_ACCELERATED);
  
  SDL_Event* mainEvent = new SDL_Event();
  
  SDL_Texture* grass_image = NULL;
  grass_image = IMG_LoadTexture(renderer, "grass.bmp");
  
  SDL_Rect grass_rect;
  grass_rect.x = 10;
  grass_rect.y = 50;
  grass_rect.w = 250;
  grass_rect.h = 250;
  
  while(!quit &amp;&amp; mainEvent-&gt;type != SDL_QUIT){
      SDL_PollEvent(mainEvent);
      SDL_RenderClear(renderer);
  
      SDL_RenderCopy(renderer, grass_image, NULL, &amp;grass_rect);
  
      SDL_RenderPresent(renderer);
  
  }
  
  SDL_DestroyWindow(window);
  SDL_DestroyRenderer(renderer);
  delete mainEvent;
  
  return 0;
  }
  </code></pre>
  
  <p>When I try to compile the code (in Code::Blocks) it gives me the error of </p>
  
  <blockquote>
    <p>Undefined reference to "IMG_LoadTexture"</p>
  </blockquote>
  
  <p>Well, I tried to change <code>IMG_LoadTexture(renderer, "grass.bmp");</code> to <code>IMG_LoadTexture(renderer, "/the/full/path/of/grass.bmp");</code>but this didn't work either. Same error. Have I written something wrong, or missed some part? Also, grass.bmp is in the same folder as main.cpp (the code above).</p>