glBlendFuncSeparate() link error

Hi,

I got a sample example for displaying image. In that code there is a call to a function named glBlendFuncSeperate(). After googling this I came to know that it is an API. The problem is when I try to build that code, it shows me linker error

error LNK2019: unresolved external symbol _glBendFuncSeparate at 16 referenced in function
error LNK2001: unresolved external symbol _glActiveTexture at 4What I want to know is even after providing opengl32.lib and glu32.lib, I am getting this linking error. Which else lib file is need to get rid of this linking message?Thanks

There is no such function defined in either of those two libs. Simply use one of the various extension loaders around.

Hi thokra,

<GL/glext.h> file is already included in that file. Is it different from these loaders…?? I found function declaration of the above two functions in this file. But definition was missing. So I was wondering how to use them.

Thanks

opengl32.dll exports only the OpenGL 1.1 functions directly, all other functions have to be accessed via function pointers. The pointers can be retrieved by wglGetProcAddress.

This is obviously very tedious, so some people developed GL loader libraries that load all the function pointers for you and you can access the functions as if they were real functions.

So, just because you have a fptr they aren’t real functions anymore? :wink:

Exactly. But what good is an awesome function prototype without an implementation?

Thanks guys. I was able to solve it by including glext.h and using wglGetProcAddress. It solved the problem. :slight_smile: