# OpenGL 3.2 on Windows

**URL:** <https://discourse.glfw.org/t/opengl-3-2-on-windows/219>\
**Category:** support\
**Created:** [July 24, 2012, 12:30pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219 "2012-07-24T12:30:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 12:30pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/1 "2012-07-24T12:30:15Z")

</div>

**[opticfroggy](https://sourceforge.net/u/opticfroggy/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#6995):

Hi,  
I do the majority of my programming on my MBpro so I know that my setup works  
fine there. I recently wanted to debug some OpenGL bits using geDebugger, as  
well as confirm my cross-platform(ness).  
When cloning my codebase down onto Win 7 I am having serious issues getting an  
OpenGL 3.2 app to compile.

```
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:62:26: error: 'glBindVertexArray' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:64:46: error: 'glBindBuffer' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:66:73: error: 'glVertexAttribPointer' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:69:41: error: 'glEnableVertexAttribArray' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:77:42: error: 'glDisableVertexAttribArray' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp: In member function 'void Actor::UpdateBuffers()':
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:172:36: error: 'glDeleteBuffers' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:177:37: error: 'glDeleteBuffers' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:182:34: error: 'glDeleteVertexArrays' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:194:30: error: 'glGenVertexArrays' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:196:26: error: 'glBindVertexArray' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:198:33: error: 'glGenBuffers' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:199:46: error: 'glBindBuffer' was not declared in this scope
C:\Users\Chris\workspace\OldYoungEngine\src\actors\Actor.cpp:200:78: error: 'glBufferData' was not declared in this scope
mingw32-make[2]: *** [CMakeFiles/main.dir/src/actors/Actor.cpp.obj] Error 1

```

This is the Errors I am getting and it would appear to be specifically GL3  
related looking at the functions that are apparently not declared.

Any ideas ?  
Anyone actually successfully get a 3.2 context to work on Windows 7 (Using  
Eclipse project generated from CMake here, although whatever IDE etc isn’t  
really important)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 12:49pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/2 "2012-07-24T12:49:41Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#4c2d):

GLFW [does not provide an OpenGL header](http://www.glfw.org/faq.html#2_13).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 1:14pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/3 "2012-07-24T13:14:34Z")

</div>

**[opticfroggy](https://sourceforge.net/u/opticfroggy/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#458c):

From what I’ve read and seen from others experiences, getting Glew to work  
with GLFW is a PITA.  
I did try it early on when I was testing this, putting the GLEW include before  
GLFW, but I still ran into issues of GLFW complaining about gl.h being  
included before (or something to that affect).

It’s such a shame that this isn’t easier.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 1:30pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/4 "2012-07-24T13:30:02Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#1442):

If you encounter any problems, or if you know where these discussions took  
place, please make a post about it.

Lots of people use GLEW with GLFW with no problems and have for years, myself  
included. If there are any issues, I’d like to know about them.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 1:49pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/5 "2012-07-24T13:49:17Z")

</div>

**[opticfroggy](https://sourceforge.net/u/opticfroggy/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#a58a):

This could be a stupid question :  
Say I have this structure for e.g.

- Main.cpp  
- Engine .h/.cpp  
- Actors  
– Actor.h/.cpp

Engine requires GLFW to do the normal initialisation etc.  
Actor requires access to GL for drawing etc.

Currently (which work on OSX) before GLEW :

```
Actor.cpp
#include <GL/glfw.h>

Engine.h
#include <GL/glfw.h>
...
#include <Actors/Actor.h>

```

This works fine, obviously this is overly simplified.

Now that I’ve added GLEW to the mix should my includes look like this ?

```
Actor.cpp
#include <GL/glew.h>
#include <GL/glfw.h>

Engine.h
#include <GL/glew.h>
#include <GL/glfw.h>

```

This is what Is giving me the error : “GL/glew.h:84:2: error: #error gl.h  
included before glew.h”

I know this is likely a really stupid / simple thing e.g. only including 'X’  
once in place ‘Y’ instead of all over the place, else it may likely be a bad  
habit I’ve picked up which is confusing me.

Thanks in advance for any pointers.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 2:05pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/6 "2012-07-24T14:05:03Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#1204):

Are you absolutely certain you’re not including the GLFW header or an OpenGL  
header before the GLEW one? The GLEW header has inclusion guards, so a second  
inclusion of it wouldn’t cause any warnings at all, regardless of what was  
included before.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 2:15pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/7 "2012-07-24T14:15:55Z")

</div>

**[opticfroggy](https://sourceforge.net/u/opticfroggy/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#81ce):

Hmm, yea after some following of includes I believe I got that sorted, however  
a linker error has now presented itself (At-least I’m past compiler errors  
lol)

```
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_window.o):win32_window.c:(.text+0x240): undefined reference to ` __imp__ wglMakeCurrent@8'
mingw32-make[2]: Leaving directory `C:/Users/Chris/workspace/OldYoungEngine'
mingw32-make[1]: Leaving directory `C:/Users/Chris/workspace/OldYoungEngine'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_window.o):win32_window.c:(.text+0x251): undefined reference to ` __imp__ wglDeleteContext@4'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_window.o):win32_window.c:(.text+0xf99): undefined reference to ` __imp__ wglGetProcAddress@4'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_window.o):win32_window.c:(.text+0x1781): undefined reference to ` __imp__ wglMakeCurrent@8'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_window.o):win32_window.c:(.text+0x18c1): undefined reference to ` __imp__ wglCreateContext@4'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_window.o):win32_window.c:(.text+0x1d56): undefined reference to ` __imp__ glGetIntegerv@8'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_window.o):win32_window.c:(.text+0x1d6d): undefined reference to ` __imp__ glGetFloatv@8'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(glext.o):glext.c:(.text+0x1c0): undefined reference to ` __imp__ glGetIntegerv@8'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(glext.o):glext.c:(.text+0x1fb): undefined reference to ` __imp__ glGetIntegerv@8'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(glext.o):glext.c:(.text+0x2f0): undefined reference to ` __imp__ glGetIntegerv@8'
E:\Development\C++Libraries\glfw-2.7.6\lib-mingw\x86\libglfw.a(win32_glext.o):win32_glext.c:(.text+0x7e): undefined reference to ` __imp__ wglGetProcAddress@4'

```

As I referenced earlier I’m using CMake if that’s any help, MinGW and MSYS on  
Win 7.

(Just to test I also tried linking against the VS lib “GLFW.lib” instead of  
"libglfw.a")

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 24, 2012, 2:50pm UTC](https://discourse.glfw.org/t/opengl-3-2-on-windows/219/8 "2012-07-24T14:50:05Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, July 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/4edcf65a/#58d4):

You should read the section on using GLFW in the  
[readme](http://www.glfw.org/release-2.7.6.html) file.
