OpenGL not Found, “cannot find -lGL”, and Other Issues with NVIDIA Drivers

Under Ubuntu,  sometimes when the NVIDIA drivers are installed, CMake cannot properly find OpenGL (specifically As a result, linking issues may occur.

The easiest fix for this is to first create a symlink of nvidia-current to nvidia-xxx where xxx is the version of the current NVIDIA driver installed (e.g. nvidia-387) . Then create a symlink from /usr/lib/ to /usr/lib/nvidia-current/

The command would be:

Note that having nvidia-current symlink is generally a good idea as it can prevent other linker errors when it comes to finding NVIDIA-specific libraries. Also, remember to update this symlink whenever NVIDIA drivers are also updated.

Leave a Reply

Your email address will not be published.