gcc cannot find -lglfw3

I completely forgot about this question until I got a notification for it. For me the solution was to not use -lglfw3 but rather use -lglfw


Find libglfw3.a or libglfw3.so on your system Mention that path to gcc using -L

gcc -Iinclude test.c -o test -L/dir/where/glfw3/resides -lglfw3 -lm -lGL -lGLU

If you've installed pkg-config, and glfw3.pc is in the search path, try:

gcc -Iinclude test.c -o test `pkg-config --libs glfw3` -lm -lGL -lGLU

If you only have the static build, use: pkg-config --static --libs glfw3, which will add the dependencies that libglfw3.a requires.

Tags:

C

Gcc

Glfw