Having an issue with "gladLoadGL". I'm getting an error saying it does not take 1 argument
Asked Answered
S

1

6

I'm trying to do some openGL tutorials (https://www.glfw.org/docs/latest/quick_guide.html#quick_example) and one of the functions is gladLoadGL. The line of code is "gladLoadGL(glfwGetProcAddress);" however when I try to run I get the error "C2660 'gladLoadGL': function does not take 1 arguments".

I've tried searching online but no one seems to be having the same issue as I am. I've looked into the glad.h file and the function has a warning "Function definition gladLoadGL not found" which maybe where my issue is coming from. When I generated the glad code (https://glad.dav1d.de/) the settings I had where Language C/C++, Specification OpenGL, gl Version 4.6, Profile Core, and Generate a loader was ticked.

gladLoadGL(glfwGetProcAddress);
Spodumene answered 22/9, 2019 at 22:35 Comment(0)
H
15

Use:

a) a loader from an already know API that has a loader, e.g. glfw

gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);

or b) directly:

gladLoadGL();

Notice the different used function.

Hogarth answered 23/9, 2019 at 0:1 Comment(2)
This worked perfectly. I ended up using your second solution and I also had forgotten to include glad.c .Thank you so muchSpodumene
first one worked for me while second one didn'tRet

© 2022 - 2024 — McMap. All rights reserved.