Unresolved Refs

I downloaded the sample programs from the NeHe website home, i.e. Lesson1, etc. When I execute the programs, all runs fine. However, when I create my own source programs using the “skeleton” source program, .cpp, from the samples, i.e. Lesson1, I try to link and get several unresolved references in the source program like gluPerspective@32, glLoadIdentity@0, etc. I know there are some files missing that are included in the sample programs but which ones are they and why am I getting the unresolved references? I would think that any references would be “pulled” from the #include files like <gl\gl.h> etc. Please let me know. Thanks, Sid Kraft

Include files only include declarations; that is, they say “this stuff exists!” They don’t provide the definition, meaning the actual meat of the function code is elsewhere. Typically, it is in a staticly or dynamically linked library, or another source file. In the case of OpenGL, they are (on Windows, which I assume you’re using) in GL.DLL and GLU.DLL. Look at your linker settings and add -lGL and -lGLU. That should do the trick.