linking error building AppParticlesOCL_Intel __glewBindBuff

darKoram
Posts: 6
Joined: Mon Nov 28, 2011 1:59 am

linking error building AppParticlesOCL_Intel __glewBindBuff

Post by darKoram »

Hi,
I've had the AllDemos app working and just tried to add my newly installed OpenCL to the build environment.

...
INTEL OPENCL SDK FOUND
/usr/lib64/libOpenCL.so
...
[ 83%] Building CXX object Demos/ParticlesOpenCL/Intel/CMakeFiles/AppParticlesOCL_Intel.dir/__/shaders.o
Linking CXX executable AppParticlesOCL_Intel
CMakeFiles/AppParticlesOCL_Intel.dir/__/btParticlesDemoDynamicsWorld.o: In function `btParticlesDynamicsWorld::adjustGrid()':
~/bullet-2.79/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp:208: undefined reference to `__glewBindBufferARB'

in "bullet-2.79/Glut/GL/glew.h" I find
#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB)

so it seems that ld is unable to find the definition in my libGLEW.

$ locate libGLEW.so
/usr/lib/libGLEW.so.1.5
/usr/lib/libGLEW.so.1.5.2
/usr/lib/x86_64-linux-gnu/libGLEW.so
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.6
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.6.0

I'm unable to find where in CMakeLists.txt it specifies which lib path is tried. I couldn't find any info on how GLEW_GET_FUN searches for functions.

Searching on the internet, I did find this:

"Specifically, if you look in glew.h, you will find
#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB)
In glew.c, you will find
PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL;
The symbol glMultiTexCoord2fARB refers to a *function pointer*. Also in
glew.c, you will find
r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress(
(const GLubyte*)"glMultiTexCoord2f")) == NULL) || r;
This is a function call that queries your graphics driver to obtain
the function pointer for glMultiTexCoord2f. If your graphics driver
does not support the extension that defines this function, the call
will return NULL."

So perhaps it is a problem with my ATI graphics driver, but I bought the laptop in 2010 so it should be fairly new.

Any suggestions on how to resolve this?

thanks,

darKoram,

Notes:
compiled with -DBUILD_SHARED_LIBS=ON
Ubuntu 11.10 on Asus Notebook with ATI Radeon HD 5470