/ usr / bin / ld: cannot find -lGL (Ubuntu 14.04)

I am trying to create a project created in QT Creator, and, unfortunately, every time I try to compile, I get an error message. Here is my compiler output:

23:02:20: Running steps for project WallpaperAppQt...
23:02:20: Configuration unchanged, skipping qmake step.
23:02:20: Starting: "/usr/bin/make" 
g++ -m64 -o WallpaperAppQt main.o mainwindow.o moc_mainwindow.o   -L/usr/X11R6/lib64 -lQt5Widgets -L/usr/lib/x86_64-linux-gnu -lQt5Gui -lQt5Core -lGL -lpthread 
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [WallpaperAppQt] Error 1
23:02:20: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project WallpaperAppQt (kit: Desktop)
When executing step 'Make'
23:02:20: Elapsed time: 00:00.
+4
source share
3 answers

You need a package that contains a symbolic link libGL.so(without a version suffix). On Ubuntu, it is in a package libgl1-mesa-dev. So simple:

sudo apt install libgl1-mesa-dev
+6
source

I was able to fix my problem by following the instructions at this link:

http://techtidings.blogspot.com/2012/01/problem-with-libglso-on-64-bit-ubuntu.html

(last two teams)

sudo rm /usr/lib/x86_64-linux-gnu/libGL.so 
sudo ln -s /usr/lib/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so 
+1
source

Obviously, it lddoes not find the lib GLdefault library that it should include in the path /lib* /usr/lib*. You must install the library GLor tell g++where lib GLwas installed with cmd args -L if it was already installed.

0
source

Source: https://habr.com/ru/post/1613926/


All Articles