GLU linking errors with VS2005

nobody wrote on Tuesday, January 29, 2008:

Hi everyone, I’ve been struggling getting GLFW installed correctly, and I finally managed to get it up and running without linker errors.

I then tried to write a small program with OpenGL, testing out my new and shiny GLFW.

Somehow, GLU doesn’t seem to be linked correctly anymore. GL-functions work, GLFW-functions work, but GLU-functions does not.

I’ve created a small testprogram to show you my errors and how they are created.

I get this error:
error LNK2019: unresolved external symbol _gluLookAt@72 referenced in function _main glfwTest.obj

With this code:

#define GLFW_DLL
#include <GL/glfw.h>

int main( void )
int width = 500;
int height = 500;

// Initialize GLFW

// Open an OpenGL window
if\( \!glfwOpenWindow\( width, height, 0,0,0,0,0,0, GLFW\_WINDOW \) \)
	return 0;

// Testing GL-function:
glClear\( GL\_COLOR\_BUFFER\_BIT \);

// Testing GLU-function:
gluLookAt\(                        // Set camera position and orientation
  0.0, 0.0, 10.0,               // Camera position \(x,y,z\)
  0.0, 0.0, 0.0,                // View point \(x,y,z\)
  0.0, 1.0, 0.0                 // Up-vector \(x,y,z\)


Now, this code doesn’t make any sense alone, ofcourse, but it is only to demonstrate that only glu-functions does not work.

Coming here is a last resort, I’ve tried searching, following FAQ’s, reading other responses, but I cannot comprehend why this is happening.

Let’s see… What other information can I give… Yes, the linker dependencies are:
opengl32.lib glfw.lib glfwdll.lib user32.lib
If I remove any of these, it won’t compile. I’ve added lib’s and dll’s where they are supposed to be, and I haven’t edited any of the headers used.

Can anyone help me with this? GLFW seems like exactly what I want to use for my schoolproject, and being in charge of input management I really thought I had found the best lib to use now.

Thanks for taking the time to look at it,

regards Matias.

kohaistyle wrote on Tuesday, January 29, 2008:

maybe you forgot to link with glu32.lib ?

nobody wrote on Tuesday, January 29, 2008:

That was it…

I’ve never had to link it before, and not seeing it in examples identical to what I was working on, didn’t link it, I only tried to link glu.lib, but that didn’t exist ofcourse.

That you ever so much, have a nice day. :slight_smile: