title: Setting up OpenGL NetBeans project with GLFW on Ubuntu
body: <p>I am trying to setup OpenGL developing environment on Ubuntu.I installed all the libs including GLFW as I don't want to use GLUT.GLEW lib has been installed too.I am trying to set it all in NetBeans.I have never used it before and currently I am getting :</p>
  
  <p><strong>undefined reference to `glfwInit'</strong>  error while running this simple code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;GL/glew.h&gt;
  #include &lt;GL/glfw.h&gt;
  #include "glm.hpp"
  using namespace std;
  using namespace glm;
  
  int main(int argc, char** argv) {
  
  
   /*      init GLFW         */
      if(!glfwInit()){
  
          fprintf(stderr,"failed to init GLFW");
  
       }
      return 0;
  }
  </code></pre>
  
  <p>I am sure it is linker related problem.So I have added libglfw.a to Linker->Libraries and then got even more errors like these:</p>
  
  <p>make[2]: Entering directory <code>/home/sasmaster/NetBeansProjects/OpenGLDemo'
  mkdir -p dist/Debug/GNU-Linux-x86  g++     -o dist/Debug/GNU-Linux-x86/opengldemo build/Debug/GNU-Linux-x86/main.o /usr/lib/libglfw.a 
  /usr/lib/libglfw.a(window.o): In function</code>glfwOpenWindow':
  /usr/lib/libglfw.a(x11_init.o): In function <code>_glfwPlatformInit':
  /usr/lib/libglfw.a(x11_init.o): In function</code>_glfwPlatformInit':
  /usr/lib/libglfw.a(x11_init.o): In function <code>_glfwPlatformInit':
  /usr/lib/libglfw.a(x11_init.o): In function</code>_glfwPlatformInit':
  /usr/lib/libglfw.a(x11_init.o): In function <code>_glfwPlatformTerminate':
  /usr/lib/libglfw.a(x11_init.o): In function</code>_glfwPlatformTerminate':
  /usr/lib/libglfw.a(x11_window.o): In function <code>translateKey':
  /usr/lib/libglfw.a(x11_window.o): In function</code>translateKey':
  /usr/lib/libglfw.a(x11_window.o): In function <code>translateKey':
  /usr/lib/libglfw.a(x11_window.o): In function</code>translateChar':
  ...........
  ........................</p>
  
  <p>What else should I link or install? </p>
  
  <p><strong>Update:</strong>
  <a href="http://sourceforge.net/projects/dark-oberon/forums/forum/227592/topic/1337724" rel="nofollow">Here</a> it is said one should add LIBRARIES='-pthread -lglfw -lGL -lX11 -lGLU -lXxf86vm'
  But where should I add those in NetBeans properties? I tried put into the MakeFile and "linker options" too and nothing helped.</p>
  
  <p><strong>Update1</strong>
  Compiling the main.cpp manually using this command:</p>
  
  <pre><code>**g++ main.cpp  -o Game -lglfw -lGL -lGLU -lX11 -lpthread -lXxf86vm -lm**
  </code></pre>
  
  <p>Compiles fine.How do I link all these libs via NetBeans???</p>