Problems compiling with glu.h

Hi, I had the following problem. I get the following error
error LNK2001: unresolved external symbol _gluPerspective. and is the same for all glu functions. but I get no errors with gl or glut functions. I’ve done everything. I know all *.h, *.lib and *.dll are in place but I still get ther error with glu functions. Any ideas?, thanks for your help in advance

did you solve the problem? I have the same problem now?
It really frustrated me. When I create a new project, it can use glu functions. looking forward to replying me. Thanks!

Well from my experience, there are two causes for this,

  1. When the glu.h is not coming from the default location and it is coming from some other project which has modified glu.h . This you can check by opening the included gl/glu.h by right clicking the include and open containing folder.
  2. You are missing glu32.lib as additional library in the linker settings. In visual studio, go to your project->properties->Linker->input->Add. depend. and add glu32.lib
    You may also add it programmatically like this,

#pragma comment(lib, "glu32.lib")

See if this helps.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.