Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: #error Attempt to include auto-generated header after including gl.h

  1. #1
    Newbie Newbie
    Join Date
    Nov 2018
    Posts
    1

    #error Attempt to include auto-generated header after including gl.h

    I am trying to include different headers to my main.cpp file, right now I only have these ones:
    Code :
    #include <glad/glad.h>
    #include "wrapper_glfw.h"
    #include "object_ldr.h"
    The problem is that I am getting this error message:

    Attempt to include auto-generated header after including gl.h
    I am not sure what does it mean or how can I fix it. I have researched for a while and I have found some problems with glad and glfw but still not sure how to fix this.

    The object_ldr.h file includes wrapper_glfw.h and wrapper_flw.h includes glfw3.h, gl_4_0.h and gl_load.h.

  2. #2
    Senior Member OpenGL Lord
    Join Date
    May 2009
    Posts
    6,066
    The object_ldr.h file includes wrapper_glfw.h and wrapper_flw.h includes glfw3.h, gl_4_0.h and gl_load.h.
    Your code seems to be quite confused. You can't use more than one OpenGL loading library at the same time (not for most of them, at any rate). Many of them create the same definitions, so they often overlap. That's why you're getting that error.

    Pick a single loading library and stick with it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •