I am trying to write a basic C OpenGL program on mac but it is failing to compile. The code is as follows:
#define GLEW_STATIC
#include <GL/glew.h>
#include<GLFW/glfw3.h>
int main()
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
return 0;
}
But I get the error when I runn gcc test.c -o test
Undefined symbols for architecture x86_64:
"_glfwInit", referenced from:
_main in test-358151.o
"_glfwWindowHint", referenced from:
_main in test-358151.o
ld: symbol(s) not found for architecture x86_64
Can someone help?