Try using an extension loader like GLEW to load newer OpenGL functions at runtime. It also provides more up to date headers where GL_SAMPLES_PASSED is declared.
In case that doesn’t help, please also tell us what OS and what OpenGL version you have.
i have installed the latest GLEW correctly, whose version is glew-1.7.0-win32. However, it still doesn’t work that comes new errors:
“error LNK2001: unresolved external symbol __imp____glewBeginQuery” and
“error LNK2001: unresolved external symbol __imp____glewEndQuery”
also, i have inlcuded glew.h before gl.h, glu.h & glaux.h like following: #include <GL/glew.h> #include <GL/gl.h> #include <GL/glu.h> #include <GL/glaux.h>
Without using glBeginQuery() or glEndQuery(), debugging is passed and the application program runs without errors.
my operation system is: WINDOWS 7_32bit
GL_VERSION is: 4.1.0
GLU_VERSION is: 1.2.2.0 Microsoft Corporation
the platform is Visual Studio 6.0;
i have read the document ‘glew.h’ and find the relevant information that maybe help when you think about this problem: #define glBeginQuery GLEW_GET_FUN(__glewBeginQuery)