PDA

View Full Version : Linking: Contains glClientActiveTexture?



Juronga
07-28-2009, 03:35 PM
I'm trying to build a library which uses opengl. Apparently, it can't find glClientActiveTexture. Using my mesa gl build, i replaced the system32 dll with its opengl32.dll and linked the linker to the opengl32.lib. I still got an error. Using dumpbin to view exports, i found that there were similar exported functions in opengl32.lib, namely
_glClientActiveTexture@4
_glClientActiveTextureARB@4

I can't use these, because its not in the .h file. So i guess i'm asking where can i find an opengl32 binary which will have this function?
Thanks!



Error:

Linking dynamic library: bin\Debug\clutter_d.dll
Creating library file: bin\Debug\libclutter_d.a
obj\Debug\clutter\cogl\common\cogl.o: In function `cogl_begin_gl':
C:/Prog/clutter-0.9.8/clutter/cogl/common/cogl.c:831: undefined reference to `glClientActiveTexture'
obj\Debug\clutter\cogl\gl\cogl-primitives.o: In function `cogl_add_path_to_stencil_buffer':
C:/Prog/clutter-0.9.8/clutter/cogl/gl/cogl-primitives.c:175: undefined reference to `glClientActiveTexture'
collect2: ld returned 1 exit status

Dark Photon
07-28-2009, 07:08 PM
What card do you have? Usually vendor drivers just get this stuff right, at least on Linux.

Can't help you much with Windows-isms, but here's the standard preamble to pull in GL function prototypes:


#define GL_GLEXT_PROTOTYPES 1
#include <GL/gl.h>
#include <GL/glu.h>

See what you get. Failing that, try sticking this up at the top of the file you're trying to compile that references glClientActiveTexture. Assuming a C++ compiler:


extern "C" {
void glClientActiveTexture (unsigned);
}

See if you can coax it to compile try make it try the link. If it does, you've prob got a good GL lib, but not including headers right or they're not installed properly.

Juronga
07-29-2009, 12:02 AM
Didn't work. Actually, the header has the function in it. It's just that for some reason it can't find it in the opengl32.lib. Actually, I built http://www.mesa3d.org/ mesagl and used that opengl32.lib and dll. I did this because the libopengl32.a that came with mingw didn't have the function in it, i think. Then again, the only reason i think it didn't have the required function was because it refused to link. Any other ideas?

dletozeun
07-29-2009, 04:40 AM
Look at this link and especially the paragraph 4.1.1:
http://www.mesa3d.org/brianp/sig97/exten.htm

See if you have done it correctly. You may also use extension loading libraries like glew or glee:
http://www.opengl.org/sdk/libs/

Juronga
07-29-2009, 10:52 AM
Thx. i finally go it to build. Actually, it was a stupid mistake on my part. First, i hadn't put the appropriate includes for mesa gl in the mingw directory and then i hadn't linked to the opengl32.lib file in the correct order.