PDA

View Full Version : glew does not fetch glDrawArraysInstancedBaseInstance



tamato
07-16-2013, 08:28 AM
I'm trying to use glDrawArraysInstancedBaseInstance but the linker complains that __glewDrawArraysInstancedBaseInstance is unresolved.
glew-1.9.0 is installed on the machine and as far as I can tell, it should be linking it.
As temporary work around, I'm just fetching the function myself, which works. But it does not help me understand why glew does not appear to be working for that function.
And actually glew does not appear to be working for anything opengl 3.3+
I'm using glfw to create my window and a 4.3 core profile context
My system:
NVidia gtx 550 ti, with latest drivers
Ubuntu 12.04

Using CMake for the make files and in CMakeLists.txt
target_link_libraries(app GL GLU GLEW glfw)

using glewExperimental = true; before glewInit()

and glfwExtensionSupported("GL_ARB_base_instance")
to verify that the function is available.

Nowhere-01
07-16-2013, 08:59 AM
try setting glewExperimental = true; before calling to glewInit();

tamato
07-16-2013, 09:07 AM
Already doing that.

Nowhere-01
07-16-2013, 09:19 AM
check your linking setting, then. i'm not familiar with unix-like operating systems, but someone else here might be, and you didn't specify how do you link to a Glew library for them to help you.

carsten neumann
07-16-2013, 12:37 PM
I suspect the version of glew that comes with your distro does not yet contain that entry point (same here on Fedora 17: grepping for DrawArraysInstancedBaseInstance through all files in /usr/include/GL only shows hits in glext.h not in glew.h). You'll have to build your own version of glew or use a different loader library.

tamato
07-17-2013, 12:41 PM
It turns out to be that when installing glew-1.9.0, it was being installed to /usr/lib64 and this was only one of the two problems that were happening.
One of the problems was that glew-1.7.0 was installed in /usr/local/lib64, and my app was using this version of glew.


I found this by doing find /usr -name libGLEW*

And the other was that ldconfig did not know about /usr/lib64.


This was found by doing ldconfig -p > report.txt and looking to see what directoriesldconfig was looking in. Which turned out to be helpful because I thought /usr/lib64 was a "trusted" directory, and that was not the case.

Armed with this information glew-1.7.0 was removed, ldconfig was updated and now everything works as expected.