I am a newbie in GLFW and I tried to make the most basic application with GLFW and OpenGL in C. I took the example code from GLFW documentation: https://www.glfw.org/documentation.html. It worked. However when I include GLAD at the top of my program it crashes at glClear(GL_COLOR_BUFFER_BIT);
with Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
. When code isn't running no errors appear and build succeeds. I've tried GLADs from both https://gen.glad.sh/ and http://glad.dav1d.de/. The build in both includes only GL of version 4.6, Core instead of Compatibility.
I am right now on Macbook Pro with M1 Pro, MacOS Monterey 12.0.1. Installed GLFW with brew install
.
Screenshots:
Xcode project setup screenshot
Screenshot of an error while running a program
Also, I am new to Xcode as well as I have always used CLion for programming so it's possible that I messed up something while trying to setup all of this.