openGL missing libGL.so after cuda istall on ubuntu 14.04 x86_64

Hi All,
Maybe you can help me with this. I have a fresh ubuntu installation. I installed the Cuda design kit, which seems to include a graphics driver to talk to my GTX460. I had not previously installed a graphics driver. Programs using openGL do not link, producing the following message:

usr/bin/ld: cannot find -lGL

From 'ld -IGL --verbose:

attempt to open //usr/local/lib/x86_64-linux-gnu/libGL.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libGL.a failed

ld: cannot find -lGL

I find that in /usr/local/lib/x86_64_linux-gnu, libGL.so is a link to mesa/libGL.so, which is a link to libGL.so.1.2.0, which doesn’t exist. From this I believe my openGL installation is not complete. I think the Nvidia graphics driver is supposed to contain this and replace the Mesa openGL if it exists.

Command ‘glxinfo | grep version’ produces this result:
OpenGL core profile version string: 4.3.0 NVIDIA 346.46

What should I do? Should I re-install Mesa? Should I uninstall the the Nvidia graphics driver 346.46 that came in the Cuda installation and then install the latest Nvidia graphics driver version 352.12? Or is my problem something else entirely?

Thanks in advance for any advice!

I just fixed my fedora 22 installation. I found that libgl.so was linked to the xorg version. So I replaced that link with the following:

ln -sf /usr/lib64/nvidia-340xx/xorg/libglx.so /usr/lib64/xorg/modules/extensions/libglx.so

I’m confident this is not the best solution. And my guess is that ubuntu uses different names or directories. I hope you are able to get it working.