View Full Version : Linking with Static OpenGL code

02-28-2005, 01:47 AM
Hello all,

I have the following problem - been at it the whole day - just not getting it

1. We are using the VC++ 6 studio and compiler.
2. We have a workspace with the following
a) TestApp ( it is a console sample application, straight from Redbook, has some openGL code).
b) TestLibrary (It is a static library, that does some work using OpenGL library).
3. I am able to build both the above applications separately.
4. If from TestApp, no call is made to the TestLibrary no linker error occurs, executes fine.
5. If a call from TestApp is made to the TestLibrary, the linker errors are there -

TestLibrary_lib.lib(TestLibrary_utility.obj) : error LNK2001: unresolved external symbol _glPopAttrib
TestLibrary_lib.lib(TestLibrary_utility.obj) : error LNK2001: unresolved external symbol _glPopMatrix

Typically it cannot link the static library to the OpenGL files.

Any clues or ideas....

- Sophia

02-28-2005, 06:23 AM
Have you declared that TestApp is dependent on TestLibrary in project properties? I'm not sure it will help, but since you're asking for ideas..
I'm not really sure that this option is in project properties, but take a look around. Should be there, somewhere.
Another idea, is what if you need to add TestLibrary_utl.lib to TestApp's library files? (Project Properties/Linker/Additional Libraries)
Good Luck!

02-28-2005, 07:05 PM
Tried this ... did nt help :(