OpenGL程序运行时glCompileShader报错

glCompileShader()运行时报不支持着色器版本

error:0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES

查看OpenGL信息

  • 工具
sudo apt install mesa-utils
  • 查看版本信息
glxinfo -B

解决

  • 添加环境变量
 export MESA_GL_VERSION_OVERRIDE=3.3

参考

  • ubuntu16.04遇到error: GLSL 3.30 is not supported.错误,解决办法
  • RuntimeError: 0:1(10): error: GLSL 3.30 is not supported.出错解决方案

你可能感兴趣的:(OpenGL,wsl,linux,OpenGL,WSL)