PDA

View Full Version : Linker issues



Macadameane
02-19-2010, 10:41 AM
An Enigma is before me.

I am getting 31 typical linker message in Visual C++ (express):
1>main.obj : error LNK2019: unresolved external symbol _glEnd referenced in function "void __cdecl drawCube(void)" (?drawCube@@YAXXZ)

This is a program I have compiled before with a different compiler. I have taken care to add opengl32.lib glu32.lib and glut32.lib as "additional dependencies." I have also verified that it is finding the lib files (located in prog files/MS SDK/Windows/v6.../lib

I have also done a dumpbin on the lib files to be sure the symbols are exported there.

What is the problem here?!

Pziko
02-19-2010, 12:22 PM
Did you #include "windows.h"?

Macadameane
02-19-2010, 01:00 PM
Yes I did (before opengl related headers)

DarkShadow44
02-19-2010, 02:07 PM
Sure that he links opengl32.lib ?

For example with Visual C++ 2008:

#pragma comment(lib,opengl32.lib)

Macadameane
02-23-2010, 06:59 AM
I don't believe you have to add the #pragma line if you have added the library in the linker options. Even so, I tried that and still have the exact same problem (plus you forgot the quotes around the library name). I did it for opengl32.lib, glu32.lib, and glut32.lib.

Any other ideas?