So basically i am compiling my program which uses GLFW
now i am successfully compiling it by using this command
gcc -o myprog glfw.c `pkg-config --static --libs glfw3`
however what i would like to know is how can i compile this simply by just using -l option
i tried the descriptions that are given by many websites and each time there was a linker DSO error and i have no idea how to fix it
and here is the latest one i tried
pkg-config --print-requires --print-requires-private glfw3
x11
xrandr
xinerama
xi
xxf86vm
xcursor
gl
after trying with these link options
gcc -o myprog glfw.c -lglfw3 -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lGL
/usr/bin/ld: //usr/local/lib/libglfw3.a(glx_context.c.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
thats the error i get which i have no idea how to fix it