title: GLUT compile errors with Code::Blocks
body: <p>A week ago, when I first tried to work with GLUT and followed <a href="http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/" rel="nofollow">this tutorial</a> it worked without any errors.
  Now, a week later I installed the same software, same libraries, but every time I try to compile the project I get these errors (and it highlights a line in the glut.h file):</p>
  
  <pre><code>obj\Debug\main.o(.text+0x1c)||In function `glutInit_ATEXIT_HACK':|
  C:\Program Files\CodeBlocks\MinGW\include\GL\glut.h|486|undefined reference to `__glutInitWithExit@12'|
  obj\Debug\main.o(.text+0x3d)||In function `glutCreateWindow_ATEXIT_HACK':|
  C:\Program Files\CodeBlocks\MinGW\include\GL\glut.h|503|undefined reference to `__glutCreateWindowWithExit@8'|
  obj\Debug\main.o(.text+0x5d)||In function `glutCreateMenu_ATEXIT_HACK':|
  C:\Program Files\CodeBlocks\MinGW\include\GL\glut.h|549|undefined reference to `__glutCreateMenuWithExit@8'|
  </code></pre>
  
  <p>I uninstalled Code:Blocks, deleted the GLUT files (glut.h, glut32.dll, glut.a) and reinstalled everything, but I still get the same errors.
  I'm completely sure my linker settings are OK since I've followed the tutorial. I also tried other tutorials, but get the same results, a bunch of errors.</p>
  
  <p>What am I doing wrong, and how can I fix it?</p>
  
  <p>Edit: Fixed! All that was needed was <code>#include &lt;GL/gl.h&gt;</code> before including <code>GL/glut.h</code>.</p>