Take the 2-minute tour ×  I am developing static library that
takes screenshots, and taking them from OpenGL applications
require special handling.  When client application links to my
static library it have to add frameworks used by my library, for
example to take OpenGL screenshots, even if client app is not
using OpenGL it have to link with OpenGLES.framework which is
bad. I am trying to check in the library if client have linked
with OpenGLES.framework and dynamically enable taking
screenshots from OpenGL.  The problem is I get compilation error
when I try to use C functions like:  if(&glReadPixels != NULL) {
As you can see, I can check for method existence, but how do I
invoke it to not cause linker error? When I compile client with
my library I get this:  Undefined symbols for architecture i386:
"_glReadPixels", referenced from:   +[TakeScreenshotUtil
takeOpenGLScreenshotWithContext:layerSize:] in libScr-
iOS.a(TakeScreenshotUtil.o)  I am trying to use  __attribute__
((weak))   but it doesn't work (does