0

I'm running Linux Mint 19.1 on my laptop and facing this problem. When I try to compile C++ program with OpenGL libraries it says:

$ make
g++     solsys.cpp  -lglut -lGLEW -lGL -lGLU -fpermissive -o solsys
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'solsys' failed
make: *** [solsys] Error 1

When I try to run already compiled programs before, but on this machine it says

./rotation: error while loading shared libraries: libGLEW.so.1.13: cannot open shared object file: No such file or directory

I actually understand the problem is in incorrect installing of libraries, but can't solve it.

glxino | grep OpenGL outputs this

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

By the way, I have problems with installing Nvidia drivers on my laptop but gave up on it.

$lspci | grep "NVIDIA"
04:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] (rev a1)

UPDATE:

$ sudo apt-get install libglew-dev libgl1-mesa-dev libglu1-mesa-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libglu1-mesa-dev is already the newest version (9.0.0-2.1build1).
libglu1-mesa-dev set to manually installed.
libglew-dev is already the newest version (2.0.0-5).
libgl1-mesa-dev is already the newest version (18.0.5-0ubuntu0~18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.

...

$ dpkg -l | grep mesa
ii  libegl-mesa0:amd64                         18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the EGL API -- Mesa vendor library
ii  libegl1-mesa:amd64                         18.0.5-0ubuntu0~18.04.1                     amd64        transitional dummy package
ii  libegl1-mesa-dev:amd64                     18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the EGL API -- development files
ii  libgl1-mesa-dev:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL API -- GLX development files
ii  libgl1-mesa-dri:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-dri:i386                       18.0.5-0ubuntu0~18.04.1                     i386         free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-glx:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        transitional dummy package
ii  libgl1-mesa-glx:i386                       18.0.5-0ubuntu0~18.04.1                     i386         transitional dummy package
ii  libglapi-mesa:amd64                        18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the GL API -- shared library
ii  libglapi-mesa:i386                         18.0.5-0ubuntu0~18.04.1                     i386         free implementation of the GL API -- shared library
ii  libgles2-mesa:amd64                        18.0.5-0ubuntu0~18.04.1                     amd64        transitional dummy package
ii  libgles2-mesa-dev:amd64                    18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL|ES 2.x API -- development files
ii  libglu1-mesa:amd64                         9.0.0-2.1build1                             amd64        Mesa OpenGL utility library (GLU)
ii  libglu1-mesa:i386                          9.0.0-2.1build1                             i386         Mesa OpenGL utility library (GLU)
ii  libglu1-mesa-dev:amd64                     9.0.0-2.1build1                             amd64        Mesa OpenGL utility library -- development files
ii  libglx-mesa0:amd64                         18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL API -- GLX vendor library
ii  libglx-mesa0:i386                          18.0.5-0ubuntu0~18.04.1                     i386         free implementation of the OpenGL API -- GLX vendor library
ii  libosmesa6:amd64                           18.0.5-0ubuntu0~18.04.1                     amd64        Mesa Off-screen rendering extension
ii  libosmesa6:i386                            18.0.5-0ubuntu0~18.04.1                     i386         Mesa Off-screen rendering extension
ii  libwayland-egl1-mesa:amd64                 18.0.5-0ubuntu0~18.04.1                     amd64        implementation of the Wayland EGL platform -- runtime
ii  mesa-common-dev:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        Developer documentation for Mesa
ii  mesa-utils                                 8.4.0-1                                     amd64        Miscellaneous Mesa GL utilities

linkage:

$ ls -l /usr/lib/x86_64-linux-gnu/libGL.so*
lrwxrwxrwx 1 root root     14 Jan 16 19:09 /usr/lib/x86_64-linux-gnu/libGL.so.1 -> libGL.so.1.0.0
-rw-r--r-- 1 root root 567624 Aug 15 12:20 /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
  • OK, so you are missing /usr/lib/x86_64-linux-gnu/libGL.so. Does it help if you re-install libgl1-mesa-dev? Run sudo apt-get --reinstall install libgl1-mesa-dev. – Stephen Kitt Jan 31 at 8:07
  • @StephenKitt I tried to re-install, but with no success – mend4x Jan 31 at 8:11
  • How did you go about trying to install the NVIDIA drivers? Did you use the NVIDIA installer, or the Mint packages? – Stephen Kitt Jan 31 at 8:14
  • I tried with Driver Manager, but after reboot I got the blank screen. I asked about it before here. With .run package the issue is with dkms. I can't remember exact problem message. – mend4x Jan 31 at 8:18
  • @StephenKitt any suggestions? – mend4x Feb 1 at 17:56
0

i decided to ask about it on Nvidia Forum and got an answer. I'd leave here a full thread so anyone could understand the whole thing around it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.