1

I have correctly installed Qt Creator on my Debian virtual machine, but I'm getting error when trying to compile default Qt project: cannot find -lGL. I searched for solution on Google, but every solution I found didn't helped me, even if the problems were almost the same. I would like someone to explain me what's happening, why that library cannot be found?

I installed libglu1-mesa-dev package, but that didn't solved the problem. I spent few days to configure Qt on my machine, but really I have no idea how to solve this library problem?

This Qt: can't find -lGL error didn't solved my problem.

Output of ldconfig -p | grep GL command is:

    libGLU.so.1 (libc6) => /usr/lib/i386-linux-gnu/libGLU.so.1
    libGLEW.so.1.7 (libc6) => /usr/lib/i386-linux-gnu/libGLEW.so.1.7
    libGL.so.1 (libc6, OS ABI: Linux 2.4.20) => /usr/lib/i386-linux-gnu/libGL.so.1
Community
  • 1
  • 1
  • 1
    Possible duplicate of [Qt: can't find -lGL error](http://stackoverflow.com/questions/18406369/qt-cant-find-lgl-error) – m.s. Oct 21 '15 at 08:26
  • I tried with that but it doesn't solve anything! –  Oct 21 '15 at 08:26
  • you need to install `libgl1-mesa-dev`, as described in the linked duplicate; you only installed `libglu1-mesa-dev` (package name with `u`) – m.s. Oct 21 '15 at 08:27
  • I tried that also but It doesn't help. –  Oct 21 '15 at 08:28

1 Answers1

1

I found the solution for my problem, so I'll share it with all of you.

As I described in question, I had a problem when trying to compile default project on Debian Qt Creator cross-compiler.

I lacked the two libraries libglu1-mesa-dev and libgl1-mesa-dev

I tried to get them via sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev, but I kept receiving errors W:Failed to fetch.. and I succeeded to solve this problem doing these three steps:

  1. sudo bash -c 'echo "nameserver 127.0.0.1" >> /etc/resolv.conf'
  2. sudo apt-get update
  3. sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev

I hope this helps to everyone who lacks any type of library not just these two!