3

I followed this tutorial to write a simple project using GLFW and glad but I don't know how to set up glad in my project. I am currently using Eclipse.

To be more precise, I am trying to ask how to correctly include glad in a project

SydC
  • 79
  • 1
  • 5

1 Answers1

1

Make sure you include the GLFW header. Also include the GLAD header BEFORE the GLFW header.

vmil
  • 421
  • 7
  • 21
  • 2
    I think my headers are correctly included. However I still got an error saying 'undefined reference to GladGLLoader'. Do you know where to put glad.h and glad.c? – SydC Jun 15 '16 at 21:36
  • Have you included the GLAD source in your project? – vmil Jun 15 '16 at 21:49
  • I did but I think I was not including it in a right place?? – SydC Jun 15 '16 at 21:51
  • Generate the GLAD loader using http://http://glad.dav1d.de/ Then copy the glad.h, glad.c, and khrplatform.h to a GLAD library folder in your src directory. – vmil Jun 15 '16 at 21:53
  • That's what I did before but it gave me a compile error when I include in my main.cpp – SydC Jun 15 '16 at 22:05
  • What is the error? – vmil Jun 15 '16 at 22:05
  • fatal error: glad/glad.h: No such file or directory – SydC Jun 15 '16 at 22:39
  • I am having the same problem in Ubuntu 18.04: fatal error: glad/glad.h: No such file or directory – PintoDoido Sep 10 '18 at 09:23
  • @vmil, that link is dead. – john-jones Nov 04 '18 at 15:53
  • two commands: to install pull glad python stuff: pip install --upgrade git+https://github.com/dav1dde/glad.git#egg=glad to made a c inc/src file with the glad python stuff: python -m glad --generator=c --spec=gl --out-path yourgladfolderpath – Timothy John Laird Dec 04 '18 at 03:24