GLSL - unresolved external on Visual C++

别来无恙 提交于 2019-12-12 23:52:52

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!