title: Compiling Glew and SDL in C++ with Code::Blocks
body: <p>I've spent the last 24 work hours trying to get this to compile, using multiple searches and tutorials (Some say I need to link it dynamically while others say I need to statically), I can not get this to work. I'm relatively new to compiling and linking so any help would be appreciated.</p>
  
  <p>Here is my code(As you can tell by my comments I was very tired last night with coding this):</p>
  
  <pre><code>#define NO_SDL_GLEXT
  #define GLEW_STATIC
  #include "GL/glew.h"
  #include "SDL/SDL.h"
  #include "SDL/SDL_opengl.h"
  
  int main (int argc, char* args[]){
      //Loads the SDL video module
      SDL_Init(SDL_INIT_VIDEO);
  
      //Creates the SDL Surface for OpenGL to draw to
      SDL_Surface* surface = SDL_SetVideoMode(800,600,32, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_OPENGL );
  
      //Sets the caption...
      SDL_WM_SetCaption("OpenGL",0);
  
      glewExperimental = GL_TRUE;
      glewInit();
  
      //Main event loop, this is the BREAD AND BUTTER LADIES AND GENTLEMEN
      SDL_Event windowEvent;
      while (true){
          if (SDL_PollEvent(&amp;windowEvent)){
              //If you close the appplication, causes it to actually stop running :D
              if (windowEvent.type == SDL_QUIT) break;
  
              //Close it with the ESC key! :D:D:D:D:D:D:D:D:D:
              if (windowEvent.type == SDL_KEYUP &amp;&amp; windowEvent.key.keysym.sym == SDLK_ESCAPE) break;
          }
              //Literally the one extra line of code needed to do double buffering
          SDL_GL_SwapBuffers();
      }
  
      //I wish I knew what this ended...LOPE JK
      SDL_Quit();
  
      return 0;
  }
  </code></pre>
  
  <p>And in the search directories I have:</p>
  
  <p>Compiler:</p>
  
  <pre><code>E:\Programs\CodeBlocks\glew-1.10.0\include
  E:\Programs\CodeBlocks\SDL-1.2.15\include
  </code></pre>
  
  <p>Linker:</p>
  
  <pre><code>E:\Programs\CodeBlocks\glew-1.10.0\lib\Release\x64
  E:\Programs\CodeBlocks\SDL-1.2.15\lib
  </code></pre>
  
  <p>And finally in the Linker settings I have </p>
  
  <p>Link libraries:</p>
  
  <pre><code>E:\Programs\CodeBlocks\glew-1.10.0\lib\Release\x64\glew32s.lib
  </code></pre>
  
  <p>Other linker options:</p>
  
  <pre><code>-lmingw32 -lglew32s -DGLEW_STATIC -lSDLmain -lSDL
  </code></pre>
  
  <p>The error I am currently getting is:</p>
  
  <pre><code>In function 'SDL_main':
  undefined reference to `glewExperimental'
  undefined reference to `glewInit@0'
  </code></pre>
  
  <p>Thank you in advance for all the help!</p>