Hello,
I’m trying to use the ARB_uniform_buffer_objects on linux with my ati 4850.
I tried to compile the example program from the specs but i encountered an odd problem. I can’t compile it.
This is the reduced code:
#define GL_GLEXT_PROTOTYPES
#include “GL/gl.h”
#include “GL/glext.h”
#include “GL/glu.h”
int main(int argc, const char** argv) {
GLuint prog_id;
glGetUniformBlockIndex(prog_id, “colors0”);
}
If i try to compile it i get a linker error:
gcc example.c -lGL
/tmp/ccsSi3Sj.o: In functionmain': example.c:(.text+0x20): undefined reference to
glGetUniformBlockIndex’
/tmp/ccsSi3Sj.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0’
collect2: ld returned 1 exit status
A friend which owns an nvidia card and uses nvidia drivers can compile the code without any problems (Debian testing). But me who only a ati 4850 can not.
I’m using Debian testing with fglrx 9-11-2 (newest) and yes the extension is supported:
jotschi@NeXuS:~$ glxinfo | grep uniform_buffer
GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra,
jotschi@NeXuS:~$ ldd /usr/lib/libGL.so.1.2
linux-gate.so.1 => (0xb7f92000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7ed1000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb7ec3000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7e9c000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e7f000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7d38000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7d34000)
/lib/ld-linux.so.2 (0xb7f93000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb7c18000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb7c15000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb7bfb000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7bf6000)
The definition of the method is only mentioned within glext.h and a mangle header:
jotschi@NeXuS:/usr/include$ grep -r glGetUniformBlockIndex .
./GL/gl_mangle.h:#define glGetUniformBlockIndex MANGLE(GetUniformBlockIndex)
./GL/glext.h:GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint, const GLchar *);
ATI ships own headers with the driver. I tried to use them but without any success.
Perhaps someone can identify the problem.
Greetings,
Jotschi