Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ OpenGL:一个简单的彩色三角形回调错误_C++_Opengl_Visual Studio 2019 - Fatal编程技术网

C++ OpenGL:一个简单的彩色三角形回调错误

C++ OpenGL:一个简单的彩色三角形回调错误,c++,opengl,visual-studio-2019,C++,Opengl,Visual Studio 2019,我有个错误 // Callback function for OpenGL debug messages void glDebugCallback(GLenum sources, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *msg, const void *userParam) { printf("DEBUG: %s\n", msg); } int initGL() { // R

我有个错误

// Callback function for OpenGL debug messages 
void glDebugCallback(GLenum sources, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *msg, const void *userParam)
{
    printf("DEBUG: %s\n", msg);
}

int initGL()
{
    // Register the debug callback function
    glDebugMessageCallback(glDebugCallback, NULL);
错误消息是

E0167   argument of type "void (*)(GLenum sources, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *msg, const void *userParam)" is incompatible with parameter of type "GLDEBUGPROC"
我使用VS2019,Windows 10 OpenGL 4.6

参见