3

I'm working on an OpenGL project, it compiles fine, running it gives the following error:

swr-130-64-133-128:assignment Marcella$ ./run
dyld: lazy symbol binding failed: Symbol not found: _gliCreateContextWithShared
  Referenced from: /System/Library/Frameworks/OpenGL.framework/Resources/GLEngine.bundle/GLEngine
  Expected in: flat namespace

dyld: Symbol not found: _gliCreateContextWithShared
  Referenced from: /System/Library/Frameworks/OpenGL.framework/Resources/GLEngine.bundle/GLEngine
  Expected in: flat namespace

I've gathered that this means there's a missing symbol in the OpenGL framework. However, nm claims otherwise:

0000000000001239 T _gliCreateContextWithShared

Asher had a similar-looking problem, but I couldn't figure out how to apply his solution to my situation.

Worth noting: I upgraded to OS X 10.9.2 recently, and all my projects depending on this library now fail with the same error.

Community
  • 1
  • 1
marsella
  • 123
  • 1
  • 6

1 Answers1

4

Fixed it by adding

export DYLD_INSERT_LIBRARIES='/System/Library/Frameworks/OpenGL.framework/Resources/GLEngine.bundle/GLEngine' 

to my .bash_profile. Probably not the most elegant solution but such is life.

marsella
  • 123
  • 1
  • 6
  • You can also add to Xcode **Environment Variables** under **Edit Scheme**. – Dalmazio Oct 28 '15 at 01:09
  • I'm also looking for a permanent solution for distributed apps, not just for apps launched within Xcode. One link suggests defining the LSEnvironment key in the app .plist file, and adding the above key and string. However, it doesn't seem to work in Yosemite 10.10.5. – Dalmazio Oct 28 '15 at 17:32