#14 Dynamic loading of OpenGL @ Xcode5.0/OSX10.9/GLFW3.0

1.7
open
nobody
None
2015-03-06
2013-11-12
Morten Henriksen
No

Line 457 in LoadOGLCore.cpp:

gl_dyld = dlopen("OpenGL",RTLD_LAZY);

Does not seem to find the OpenGL framework library under Xcode5/OSX10.9 using GLFW3 and core profile. My application would crash on startup with:

AntTweakBar: OpenGL Core Profile functions cannot be loaded.

And otherwise work just fine when commenting out the Tw* calls. I was compiling with flags

-L/usr/local/lib -I/usr/local/include -lAntTweakBar -lGLFW3

With the OpenGL framework linked through build options in Xcode.

Eventually I found that changing the above to instead use the full path:

gl_dyld = dlopen("/System/Library/Frameworks/OpenGL.framework/OpenGL",RTLD_LAZY);

Solved the problem for me.

Discussion

  • Zhivko
    Zhivko
    2013-11-13

    I created the exact same ticket 2 days ago. I am amazed you didn't see it.

     
    Last edit: Zhivko 2013-11-13
  • pixel
    pixel
    2013-12-18

    Easy fix is to change dlopen line to:

    gl_dyld = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY );

    EDIT: OH! Wish i had read this before. Would have saved me some crazy time.

     
    Last edit: pixel 2013-12-18