Link error on linux

i have problem with compiling :

gcc ~/test.cpp
/usr/bin/ld: /tmp/cc4hXN39.o: in function main': test.cpp:(.text+0x5): undefined reference to glfwInit’
collect2: error: ld returned 1 exit status

the file only consist of <GLFW/glfw3.h>
and glfwInit();

You need to link against glfw, see the GLFW building applications guide.

If you don’t mind using cmake to generate your makefiles then take a look at:

starter will open a window right ? it didn’t work on that way, but i make install them. and all is good in /usr/lib directory but still can’t link

After make all you should see a program called GLFW-CMAKE-starter which you can run - I’ll get the readme changed to reflect that.

thanks it’s working well.