Function error in C

I have used GLFW with C++ for a while now, however, when I tried using the example code in a C program upon compiling I was given multiple errors.
These errors said that the gl functions were referenced without being defined. I have no clue what I’m supposed to do

Hi, welcome to the GLFW forum!

This sounds like a linking error - i.e. you have not linked to GLFW, however without the full error message it’s tricky to say.

See the GLFW Building Applicaitons documentation for help.

You could also modify the GLFW-CMake-starter to use C by changing the main.cpp to main.c and modifying it’s contents to be C, and change the CMakeLists.txt line 19 to refer to your new main.c file.

1 Like

Thanks for the help however I realized my problem was due to not defining the glfw header upon compiling: gcc main.c -o Program -lGL -lglfw