I'm currently trying to write a little game with OpenGL. I got 2 classes:
- CoreEngine: for managing the Window, rendering, updating and so on
- Mesh: for creating and managing meshes
Includes from CoreEngine.h:
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <vector>
#include "RenderingEngine.h"
#include "GameObject.h"
Includes from Mesh.h:
#ifndef _MESH_H_
#define _MESH_H_
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <string>
The reason is that I need functions from OpenGL in CoreEngine.h and in Mesh.h, but when I try to compile I get this error:
Fehler 1 error C1189: #error : gl.h included before glew.h
I can't find a way, to prevent this error and to have OpenGL functions in both classes at the same time.