Hello,
I’m encountering an issue when trying to compile my project using Visual Studio. The error is as follows
#error: gl.h included before glew.h
This error occurs when I try to build my project. From my understanding, glew.h
needs to be included before gl.h
, but I can’t find any instances where I explicitly include gl.h
before glew.h
.
Steps I have taken so far:
- Ensured that
glew.h
is included before any OpenGL-related headers. - Checked all files for any accidental
#include <GL/gl.h>
statements. - Ensured
glewInit()
is called correctly in my project initialization.
Build Information:
- IDE: Visual Studio 2022
- Dependencies: GLEW, GLFW
- Compiler: MSVC 2019 (x64)
What I’ve Tried:
- Reorganized includes to ensure
glew.h
always appears beforegl.h
. - Rebuilt the project after each change.
- Cleaned and rebuilt the solution multiple times.
- Checked if any third-party libraries are including
gl.h
incorrectly.
Any help or suggestions would be appreciated. Let me know if I need to provide more information about the issue.
Thanks!