问题
I'm getting started with the GLSL. What should i do to resolve this:
error LNK2001: unresolved external symbol _pglLinkProgram
error LNK2001: unresolved external symbol _pglAttachShader
error LNK2001: unresolved external symbol _pglCompileShader
error LNK2001: unresolved external symbol _pglShaderSource
error LNK2001: unresolved external symbol _pglCreateShader
error LNK2001: unresolved external symbol _pglCreateProgram
error LNK2001: unresolved external symbol _pglGetProgramInfoLog
error LNK2001: unresolved external symbol _pglGetProgramiv
error LNK2001: unresolved external symbol _pglUseProgram
回答1:
You seem to be using some form of library that wraps GL entrypoints (the entrypoints you list are not direct GL entrypoints).
This library (GLEE ?) likely is coming with a .lib file that you need to link against.
Coming from the project page of GLEE (my guess, based on a quick googling of who is using the prefix p for GL calls):
Usage examples
To use GLee, include GLee.h, then simply link to GLee.lib or alternatively add GLee.c to your project.
回答2:
You have to link your program against opengl32.lib, see here.
回答3:
I recommend you start using GLEW since OpenGL > 1.5 on Windows is a bit of a pain in the ass. This will get you all OpenGL entry points without messing with extension pointers.
来源:https://stackoverflow.com/questions/4625603/glsl-unresolved-external-on-visual-c