Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to solve Issue- "cannot find -lGL" in Qt5 installed in ubuntu
unmesh last edited by
I run my project from one system. It run verry well. It is simple addition with GUI. (GUI consist of 3 LineEdit and one pushButton).
After compling from one system. then i try to run project on another system then it gives following error (issues)
:-1: error: cannot find -lGL
:-1: error: collect2: ld returned 1 exit status
How to solve this problem?? Help me..........
Install the OpenGL development libraries for your system. Probably something along the lines of mesa-devel or gl-devel.
goblincoding last edited by
For future reference, installing libglu1-mesa-dev worked for me (Ubuntu 12.04)
I have the same problem but libGL.so is already on my system but instead of "/usr/lib" it is in "/usr/lib/i386-linux-gnu/mesa/libGL.so". I think I just need to tell qtcreator the actual path. Can you tell me hoe to do that?
That sounds like the 32-bit support libs rather than the native 64-bit one. Are you running a 64-bit OS? If so you need to find the relevant package that includes libGL.so.
My OS is Linux Mint 15 32 bit and it is running as a guest using virtual box on windows 7 64 bit
OK then, in that case you need to ensure that the runtime linker, ldd, can find libraries in that directory.
yes exactly but how can I do that using qmake can u tell me?
It's probably best to fix this at the system level instead. One way would be to symlink libGL.so.1 within /usr/lib. This may go against your distro's recommended approach for switching between OpenGL implementations, I don't know though.