<p>Changed the core profile to <code>3.2</code> by setting the window hints.</p>
<pre><code>glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
</code></pre>

CC BY-SA 3.0
2015-12-28T07:35:46.130Z
Kinda looks like you changed it to `3.2`.
Rotem
CC BY-SA 3.0
2015-12-28T18:32:20.553Z
Well, in my code its 4.1 haha
Leonardo D. Mariscal
CC BY-SA 4.0
2015-12-28T00:35:18.687Z
2022-04-21T13:38:53.840Z
2022-04-21T13:38:53.840Z
Leonardo D. Mariscal
<p>I'm programming on a Mac and I'm learning OpenGL in the library GLFW. </p>

<p>My problem is that my Mac supports OpenGL up to version 4.1, but when I try to compile the shaders with <code>version 410</code> it says <code>ERROR: 0:1: '' :  version '410' is not supported</code>. </p>

<p>How do I set the version that GLFW should use?</p>

CC BY-SA 3.0
2015-12-29T15:10:54.010Z
you can use glGetString(GL_SHADING_LANGUAGE_VERSION) to see which glsl versions are available to you. printf("Supported GLSL version is %s.\n", (char *)glGetString(GL_SHADING_LANGUAGE_VERSION));
Senne
<opengl><c++><glsl>
How to set the GLFW OpenGL target?
Leonardo D. Mariscal
# How to set the GLFW OpenGL target?

(Asked by: username_0 on 2015-12-27)

I'm programming on a Mac and I'm learning OpenGL in the library GLFW.

My problem is that my Mac supports OpenGL up to version 4.1, but when I try to compile the shaders with `version 410` it says `ERROR: 0:1: '' : version '410' is not supported`.

How do I set the version that GLFW should use?

**Tags:** opengl, c++, glsl

> **Comments:**
> **username_1**: you can use glGetString(GL_SHADING_LANGUAGE_VERSION) to see which glsl versions are available to you. printf("Supported GLSL version is %s.\n", (char *)glGetString(GL_SHADING_LANGUAGE_VERSION));  

---

## 1 answers

### Answer by username_0 on 2015-12-28. Score: 1

Changed the core profile to `3.2` by setting the window hints.

```
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

```

> **Comments:**
> **username_2**: Kinda looks like you changed it to `3.2`.  
> **username_0**: Well, in my code its 4.1 haha  

---

