The error message 'Qt QOpenGLShader::compile(Vertex): ERROR: 0:1: 'core' : invalid version directive' indicates that there is an issue with the version directive in your vertex shader code.

In OpenGL, the version directive specifies the version of the OpenGL Shading Language (GLSL) that the shader code is written in. The version directive must be placed at the top of the shader code and should follow a specific syntax.

To fix the error, you need to ensure that the version directive in your vertex shader code is valid. Here is an example of a valid version directive:

#version 330 core

In this example, the version directive specifies that the shader code is written in GLSL version 3.30, using the core profile.

If you are using a different version of GLSL or a different profile, you need to adjust the version directive accordingly.

Make sure that the version directive is the first line of your shader code and that it follows the correct syntax. After fixing the version directive, try compiling the shader again.


原文地址: http://www.cveoy.top/t/topic/pkuS 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录