title: Calling gluPerspective and gluLookAt gives me an undefined reference?
body: <p>I'm trying the following source, from <a href="https://www.packtpub.com/application-development/instant-glew-instant" rel="nofollow noreferrer">Instant Glew</a>:</p>
  
  <pre><code>#include &lt;GL/glew.h&gt;
  #include &lt;GL/freeglut.h&gt;
  #include &lt;GL/glu.h&gt;
  #include &lt;GL/gl.h&gt;
  
  void initGraphics()
  {
      glEnable(GL_LIGHTING);
      glEnable(GL_LIGHT0);
      const float lightPos[4] = {1, .5, 1, 0};
      glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
  
      glEnable(GL_DEPTH_TEST);
      glClearColor(1.0, 1.0, 1.0, 1.0);
  }
  
  void onResize(int w, int h)
  {
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      glViewport(0, 0, w, h);
      gluPerspective(40, (float) w / h, 1, 100);
      glMatrixMode(GL_MODELVIEW);
  }
  
  void onDisplay()
  {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
      glLoadIdentity();
      gluLookAt(0.0, 0.0, 5.0,
            0.0, 0.0, 1.0,
            0.0, 1.0, 0.0);
  
      glutSolidTeapot(1);
      glutSwapBuffers();
  }
  
  int main(int argc, char** argv)
  {
      glutInit(&amp;argc, argv);
      glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE);
      glutInitWindowSize(500, 500);
      glutCreateWindow("Teapot");
  
      initGraphics();
      glutDisplayFunc(onDisplay);
      glutReshapeFunc(onResize);
  
      glutMainLoop();
      return 0;
  }
  </code></pre>
  
  <p>My build setup is the <strong>Windows 10 VSCode</strong>, with <strong>MSYS2</strong>, and a <strong>Makefile</strong> like this:</p>
  
  <pre><code>OBJS = 01-teapot.cpp
  OBJ_NAME = C:/&lt;"MyProjectPath"&gt;/build/01-teapot
  INC_PATH = -IC:/msys64/mingw64/include/GL -LC:/msys64/mingw64/include/GL
  INC_LINK_LIBS = -lglew32 -lopengl32 -lfreeglut
  compiling :
      g++ -Wall $(OBJS) $(INC_PATH) $(INC_LINK_LIBS) -o $(OBJ_NAME) -g
  </code></pre>
  
  <p>But the output is like:</p>
  
  <pre><code>C:\Users\&lt;"myUser"&gt;\AppData\Local\Temp\cc5d3AtP.o: In function `onResize(int, int)':
  c:\&lt;"MyProjectPath"&gt;\PaPu_Instant_GLEW/01-teapot.cpp:22: undefined reference to `gluPerspective'
  C:\Users\&lt;"myUser"&gt;\AppData\Local\Temp\cc5d3AtP.o: In function `onDisplay()':
  c:\&lt;"MyProjectPath"&gt;\PaPu_Instant_GLEW/01-teapot.cpp:31: undefined reference to `gluLookAt'
  collect2.exe: error: ld returned 1 exit status
  make: *** [Makefile:32: compilando] Error 1
  </code></pre>
  
  <p>I really don't know where I'm failing. Did I forget to link some lib? I tried to add <code>-lglut -lGLU</code> already, on the linked libs, but the compiler can't find it...</p>