title: Why does Code::Blocks show multiple definition of error?
body: <p>I'm using the code <a href="http://lazyfoo.net/SDL_tutorials/lesson36/index.php" rel="nofollow">here</a> and I want all the  functions which call SDL functions to be in a different header file instead of the main .cpp file. So I created a new file called Methods.h.
  Here is what the files look like:</p>
  
  <pre><code>main.cpp:
  
  #include "Methods.h"
  ...
  
  Methods.h:
  
  #include "SDL/SDL.h"
  #include "SDL/SDL_opengl.h"
  ....
  </code></pre>
  
  <p>And I removed all the functions from main and put them in Methods.h</p>
  
  <p>When I try to build the project, it says "multiple definition error".</p>
  
  <pre><code>/media/Data1/Projects/OpenGL/Game2/Methods.h|29|multiple definition of `event'|
  obj/Debug/main.o:/media/Data1/Projects/OpenGL/Game2/Methods.h|29|first defined here|
  obj/Debug/src/Machine.o||In function `drawFrame()':|
  /media/Data1/Projects/OpenGL/Game2/Methods.h|29|multiple definition of `drawFrame()'|
  obj/Debug/main.o:/media/Data1/Projects/OpenGL/Game2/Methods.h|29|first defined here|
  obj/Debug/src/Machine.o||In function `init_GL()':|
  /media/Data1/Projects/OpenGL/Game2/Methods.h|73|multiple definition of `init_GL()'|
  obj/Debug/main.o:/media/Data1/Projects/OpenGL/Game2/Methods.h|73|first defined here|
  obj/Debug/src/Machine.o||In function `init()':|
  /media/Data1/Projects/OpenGL/Game2/Methods.h|97|multiple definition of `init()'|
  obj/Debug/main.o:/media/Data1/Projects/OpenGL/Game2/Methods.h|97|first defined here|
  obj/Debug/src/Machine.o||In function `clean_up()':|
  /media/Data1/Projects/OpenGL/Game2/Methods.h|123|multiple definition of `clean_up()'|
  obj/Debug/main.o:/media/Data1/Projects/OpenGL/Game2/Methods.h|123|first defined here|
  </code></pre>