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

  • Home
  • SEARCH
  • 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 4593428
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:40:58+00:00 2026-05-21T22:40:58+00:00

i want to use the commands : glBeginQuery glEndQuery glGetQueryObjectiv glGenQueries but the compiler

  • 0

i want to use the commands :

glBeginQuery

glEndQuery

glGetQueryObjectiv

glGenQueries

but the compiler gives me “..was not declared”

I use linux and i have these header files (which work fine until now)

          #include <GL/gl.h>
          #include <GL/glu.h>
          #include <GL/glut.h>
          #include <GL/glx.h>

          #include <X11/X.h>    
          #include <X11/keysym.h>

Is there a solution for this?

  • 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-05-21T22:40:59+00:00Added an answer on May 21, 2026 at 10:40 pm

    The query functions are declared in glext.h. Note that including this file will not magically initialize function pointers nor check for feature availability (although 1.5 functionality is pretty much omnipresent, a well-written program cannot simply assume that it works). You must at the very least initialize pointers properly or your program will crash and burn.

    If you have no idea what I’m talking about now or if you are unsure in any way, download GLEW. That will save you a lot of pain.

    EDIT: A more elaborate explanation of how it works is this: The functionality that goes beyond core 1.2 (or 1.3 in the case of Linux, I believe) is only implemented via a function pointer mechanism. For that, a function like glBeginQuery would have a function pointer typedef named PFNGLBEGINQUERYPROC which you use to initialize a static global variable called glBeginQuery. You are of course free to do anything else too (you can put all your function pointers into a struct, or give them silly names), but this is what is most commonly done.

    You also have to check that the proper version and/or extensions are supported, otherwise you don’t know whether the functionality that you want is implemented at all.

    GLEW does all that for you so it just works if you do:

    #include <GL/glew.h>
      ...
    if (glewInit() != GLEW_OK)
        fail_with_error();
    

    Sidenote: You can have glext.h generate prototypes by defining GL_GLEXT_PROTOTYPES, but this is not very useful, because it will cause the linker to complain about a missing symbol (in fact, I’ve always been wondering why this exists at all).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a console that I want to use to invoke commands on a
I want to use HTTP GET and POST commands to retrieve URLs from a
I want to use the Web Browser control within an mono application, but when
I dont want to use commands or any similar module that uses unix shell.
I want to use system commands like mkdir and rmdir while running a java
i want to use the dos commands in my ansi-c program how can i
I want to use svn command line with beyond compare and get the following
I want to use part of the output of a command run from the
Below is my stored procedure. I want use stored procedure select all row of
I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom

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.