Code
#include <glad.h>
#include <glad.c>
#include <GLFW/glfw3.h>
int main()
{
glfwInit();
GLFWwindow* window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
while (!glfwWindowShouldClose(window))
{
glClear(GL_COLOR_BUFFER_BIT);
}
return 0;
}
Background information
My Operating System is the latest version of windows 10
I use visual studio v16.6.3 (latest)
I am very new (just learned of openGL today) and am trying to learn how to make graphics with openGL
I use glad and GLFW
Problem
The program is supposed to spawn a blank unresponsive window
Except when running the program, the window gets created but then the glClear command returns error "Exception thrown at 0x0000000000000000 in Project1.exe: 0xC0000005: Access violation executing location 0x0000000000000000."
What I have tried
(Unsuprisingly) commenting out the problem code caused the program to run correctly
I have reinstalled my graphics card drivers
I have tried installing a bunch of different glad combinations on the generator site
I have tried running the program in 32bit and 64bit (using the cooresponding GLFW bit-type)
Commenting out #include <glad.h> and <glad.c> caused the program to function properly
Images
Program Properties:
. C/C++:
. . General: https://i.stack.imgur.com/nirHo.png
. Linker:
. . General: https://i.stack.imgur.com/zHkLT.png
. . Input: https://i.stack.imgur.com/TbEiM.png
Files:
. GLFW: https://i.stack.imgur.com/DTxeX.png
. Glad: https://i.stack.imgur.com/GXNaw.png