linker doesn't find NVIDIA libraries

Bug #1487134 reported by Juan Simón
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-340-updates (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have installed the package 'nvidia-340-updates' and 'nvidia-340-updates-dev'.
When I compile a program that it uses these libraries it fails when it tries to link them:
...
/usr/bin/cc -DHAVE_AVVDPAUContext -Wl,--as-needed -Wl,-s -Wl,-S -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -fuse-linker-plugin CMakeFiles/cmTryCompileExec2899732480.dir/src.c.o -o cmTryCompileExec2899732480 -rdynamic -lasound -lgio-2.0 -lXrandr -lXrender -lX11 -lXcursor -lGL -lconfig -ldrm -levent_pthreads -levent -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lssl -lcrypto -ldl -lrt -lm -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lGLESv2 -lpulse -lavcodec -lavutil -lva-x11 -lva -lvdpau -lgio-2.0 -lXrandr -lXrender -lX11 -lXcursor -lGL -lconfig -ldrm -levent_pthreads -levent -lpangocairo-1.0 -lpangoft2-1.0 -lssl -lcrypto -ldl -lrt -lm -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lGLESv2 -lpulse -lavcodec -lavutil -lva-x11 -lva -lvdpau
/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lGLESv2
...

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: nvidia-340-updates 340.76-0ubuntu0.1
Uname: Linux 4.1.6-040106-i7 x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.12
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Aug 20 18:47:15 2015
InstallationDate: Installed on 2014-07-18 (398 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: nvidia-graphics-drivers-340-updates
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Juan Simón (simonbcn) wrote :
Revision history for this message
Juan Simón (simonbcn) wrote :

echo "int main(void){return 0;}" | gcc -x c - -lGL
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status

But

$ ldconfig -p | grep libGL.so
 libGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-340-updates/libGL.so.1
 libGL.so.1 (libc6) => /usr/lib32/nvidia-340-updates/libGL.so.1
 libGL.so (libc6,x86-64) => /usr/lib/nvidia-340-updates/libGL.so
 libGL.so (libc6) => /usr/lib32/nvidia-340-updates/libGL.so

$ ldconfig -p | grep libGLESv2.so
 libGLESv2.so.2 (libc6,x86-64) => /usr/lib/nvidia-340-updates/libGLESv2.so.2
 libGLESv2.so.2 (libc6) => /usr/lib32/nvidia-340-updates/libGLESv2.so.2
 libGLESv2.so (libc6,x86-64) => /usr/lib/nvidia-340-updates/libGLESv2.so
 libGLESv2.so (libc6) => /usr/lib32/nvidia-340-updates/libGLESv2.so

$ cat /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf
/usr/lib/nvidia-340-updates
/usr/lib32/nvidia-340-updates

Revision history for this message
Juan Simón (simonbcn) wrote :

I have try to reconfigure alternative for i386-linux-gnu_gl_conf and this is the output:

There are 2 choices for the alternative i386-linux-gnu_gl_conf (providing /etc/ld.so.conf.d/i386-linux-gnu_GL.conf).

  Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/nvidia-340-updates/alt_ld.so.conf 8604 auto mode
  1 /usr/lib/nvidia-340-updates-prime/alt_ld.so.conf 8603 manual mode
  2 /usr/lib/nvidia-340-updates/alt_ld.so.conf 8604 manual mode

But 'usr/lib/nvidia-340-updates/alt_ld.so.conf' and '/usr/lib/nvidia-340-updates-prime/alt_ld.so.conf' are empties files. Why it doesn't point to '/usr/lib/nvidia-340-updates/ld.so.conf'?

Revision history for this message
Juan Simón (simonbcn) wrote :

Sorry, I have seen that 'x86_64-linux-gnu_gl_conf' points to correct conf file:

There are 3 choices for the alternative x86_64-linux-gnu_gl_conf (providing /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf).

  Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/nvidia-340-updates/ld.so.conf 8604 auto mode
  1 /usr/lib/nvidia-340-updates-prime/ld.so.conf 8603 manual mode
  2 /usr/lib/nvidia-340-updates/ld.so.conf 8604 manual mode
  3 /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf 500 manual mode

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.