PDA

View Full Version : link error with WGL_ARB_render_texture



Quaternion
05-11-2002, 05:01 AM
Hi,
When I try to initialize the WGL_ARB_render_texture extension functions I get a "unresolved external symbol" link error for the three function:

error LNK2001: unresolved external symbol "int (__stdcall* wglSetPbufferAttribARB)(struct HPBUFFERARB__ *,int const *)" (?wglSetPbufferAttribARB@@3P6GHPAUHPBUFFERARB__@@P BH@ZA)
error LNK2001: unresolved external symbol "int (__stdcall* wglReleaseTexImageARB)(struct HPBUFFERARB__ *,int)" (?wglReleaseTexImageARB@@3P6GHPAUHPBUFFERARB__@@H@ ZA)
error LNK2001: unresolved external symbol "int (__stdcall* wglBindTexImageARB)(struct HPBUFFERARB__ *,int)" (?wglBindTexImageARB@@3P6GHPAUHPBUFFERARB__@@H@ZA)

I get the same for wglGetExtensionsStringARB. I don't get any error for the WGL_ARB_pbuffer and WGL_ARB_pixel_format functions. What am I doing wrong?

Thanks,
Shlomi

knackered
05-11-2002, 05:20 AM
You shouldn't be getting a linking error with a dll entry point.
If you've declared wglWhatever as a static member in a class, make sure you repeat the declaration at the top of the .cpp file of that class. Like this:-





In your MYCLASS.H file:-

class MyClass
{
static WGLWHATEVER_FUNCPTR wglWhatever;
};


Now in your MYCLASS.CPP file:-

WGLWHATEVER_FUNCPTR MyClass::wglWhatever=0;

Quaternion
05-11-2002, 05:35 AM
I declare the entries as extern in a header file like all other extensions entry points...

Shlomi

V-man
05-11-2002, 05:38 AM
If you want to have global functions (global function pointers actually)

you should make a .h file and you declare them as extern

extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;

and in your .cpp file you define it

PFNGLACTIVETEXTUREARBPROC glActiveTextureARB=NULL;

and you also have to initialize them pointers of course.....

Im guessing you took a short cut in your previous projects and you didn't get into trouble then.

Just put
#include <GL/myglextension.h> in your projects

V-man

Quaternion
05-11-2002, 08:30 AM
I know I have to declare the global functions in a cpp and in an header file as well, but (for some reason) I never done that for the opengl extensions entry points, and it always worked just fine.

I declared the functions' pointers in a cpp and now it works, but I still don't know why the other extensions entry points doesn't need to be declared in a cpp.

zeckensack
05-11-2002, 10:58 AM
Originally posted by Quaternion:
I declared the functions' pointers in a cpp and now it works, but I still don't know why the other extensions entry points doesn't need to be declared in a cpp.
Maybe because you never call them?

Quaternion
05-11-2002, 11:07 AM
of course I call them...

Quaternion
05-11-2002, 11:10 AM
never mind, it works now. One more thing, Do the latest nVidia drivers support WGL_ARB_render_texture? It doesn't appear in my WGL extensions list.

Shlomi