0

whenever i am trying to compile my code using the library glad i am getting to following error

c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\SUPERS~1\AppData\Local\Temp\ccjffJti.o:main.cpp:(.rdata$.refptr.glad_glClearColor[.refptr.glad_glClearColor]+0x0): undefined reference to `glad_glClearColor'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\SUPERS~1\AppData\Local\Temp\ccjffJti.o:main.cpp:(.rdata$.refptr.glad_glViewport[.refptr.glad_glViewport]+0x0): undefined reference to `glad_glViewport'
Alan Birtles
  • 32,622
  • 4
  • 31
  • 60
  • Could you please post some code to see where is the issue? – Bilal Ahmed Jan 27 '22 at 08:49
  • 1
    mini-guide [How to include GLAD](https://rpxomi.github.io/) – pmg Jan 27 '22 at 08:52
  • 1
    Your problem is not compiling, it's linking. The linker is reporting that at least one of the object files/libraries in your project uses something named `glad_glViewport` but it hasn't found anything with that name. Working back (to C++ or C code) one of your source files has declared and used `glad_glViewport` but none have defined it. `glad_glViewport` might be a function (declared and called, not implemented) or a static object (declared and used, not defined/created) or maybe something else. You haven't provided enough information, so you need to find the missing `glad_glViewport` – Peter Jan 27 '22 at 09:08
  • 1
    Likely missing the appropriate `-l` compiler flag. – sweenish Jan 27 '22 at 09:13

0 Answers0