I'm trying to compile an SDL2 and OpenGL game on linux, but the error that shows up is always
/usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit status
Which led me to find out which opengl version I have. But it shows this:
OpenGL version string: 4.5.0 NVIDIA 375.39
But I don't know which parameter or library to use with nvidia opengl.
Does anyone know?
Fixed it easily by just swapping out -lGL with -l:libGL.so.1. But find out what library you have using
ls /usr/lib/
and then look for libGL.so.version_number_here
Works for me until I need to add it to my linker.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.