Cannot find -lGL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libglvnd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I was trying to compile a OpenGL program, but it fails to compile. I suppose the package this bug is in is really libglvnd-dev, but I could not find that in Launchpad.
Anyway, the linking error is:
/usr/bin/
collect2: error: ld returned 1 exit status
This seems to be because the symlink libGL.so is missing. If I go to /usr/lib/
sudo ln -s libGL.so.1 libGL.so
then compiling works.
Here is a (nonsensical) test program:
#include <GL/gl.h>
int main(int argc, char *argv[])
{
return 0;
}
which I compile with:
gcc testgl.c -lGL
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libgl1 1.0.0-2ubuntu2
ProcVersionSign
Uname: Linux 4.15.0-20-generic x86_64
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
CurrentDesktop: KDE
Date: Fri May 11 15:48:17 2018
EcryptfsInUse: Yes
InstallationDate: Installed on 2018-04-29 (12 days ago)
InstallationMedia: Kubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: libglvnd
UpgradeStatus: No upgrade log present (probably fresh install)
Do you have the proprietary nvidia driver installed by chance?