title: collect2.exe [Error] ld returned 1 exit status
body: <p>I am programming since a few days and I simply want to open a window with opengl. I got glew and glfw, I linked the library of glew and the headers of both but when I compile I get an error. I've got windows7. I use def c++.</p>
  
  <p>This is the code:</p>
  
  <pre><code>#define GLEW_NO_GLU
  #define GLFW_NO_GLU
  
  #include &lt;GL/glew.h&gt;
  #include &lt;GLFW/glfw3.h&gt;
  
  
  int main() {
  GLFWwindow* window1 = glfwCreateWindow(640, 480, "window1", NULL, NULL);
  glfwMakeContextCurrent(window1);
  return 0;
  }
  </code></pre>
  
  <p>And this are the errors:</p>
  
  <pre><code>C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL\main.o   In function `main':
  C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL\main.cpp undefined reference to `glfwCreateWindow'
  C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL\main.cpp undefined reference to `glfwMakeContextCurrent'
  C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL\collect2.exe [Error] ld returned 1 exit status
  </code></pre>
  
  <p>This is the compiler log or however it is called:</p>
  
  <pre><code>Compiler: TDM-GCC 4.7.1 32-bit Release
  Building Makefile"C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL\Makefile.win"
  Führe  make... aus
  mingw32-make.exe -f "C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL\Makefile.win" all
  g++.exe -D__DEBUG__ main.o -o Projekt2.exe -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib32" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc glew-1.10.0/lib/Release/Win32/glew32.lib -m32 -g3
  
  main.o: In function `main':
  C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL/main.cpp:9: undefined reference to `glfwCreateWindow'
  C:\Users\Stefan\Desktop\Programmieren\Code\c++_Projekt2_OpenGL/main.cpp:10: undefined reference to `glfwMakeContextCurrent'
  collect2.exe: error: ld returned 1 exit status
  
  mingw32-make.exe: *** [Projekt2.exe] Error 1
  
  Compilation failed after 0,14 seconds with errors
  </code></pre>