Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7970177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:21:26+00:00 2026-06-04T07:21:26+00:00

I am developing static library that takes screenshots, and taking them from OpenGL applications

  • 0

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) {
    glReadPixels(0, 0, size.width, size.height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
}

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 (doesn’t change anything).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:21:27+00:00Added an answer on June 4, 2026 at 7:21 am

    You can open app being executed and check if it links to OpenGL. First, recompile your app with -rdynamic (or whatever equivalent Apple’s GCC understands). Then use the following code to find a function:

    #import <dlfcn.h>
    
    void (*_glReadPixels)(int, int, float, float, int, int, void *);
    _glReadPixels = dlsym(NULL, "glReadPixels");
    if (_glReadPixels != NULL) {
        /* take screenshot */
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m developing a software in C# that uses static functions from a C++ .dll
I'm developing a static library that will be distributed to other developers, who may
I'm developing a small haskell program that uses an external static library I've developed
I am developing a library that initializes plain-old data objects from data retrieved from
I'm developing a static library in Obj-C for a CocoaTouch project. I've added unit
I'm currently in the process of developing a fairly large static library which will
I'm developing an application that will allow users to call external code from both
I am developing a library for Android applications which does not use native code
I am developing an application that need a certificate verification from the server. It
I'm developing a static library where i need to use the open source SBJson

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.