Blender compile-Linux: help with this error

Hi guys,

I usually check out blender’s source vis SVN and compile it using scons without any problems, but ever since the last week I’m getting this error:

/usr/bin/ld: cannot find -lGL

And I didn’t get it before. I kinda understand what it means, but I got no idea of how to fix it. I’m not sure if it may have to do with some 32 bit libraries I installed on Ubuntu64 to be able to run blitzmax (blitzmax has got no 64 bit version for linux), and now my libraries are crossed :eyebrowlift2: .
If any of you got any ideas I’d really appreciate any help.

regards,
Alvaro F. Celis

Do you have the mesa and mesa-dev packages installed?

Thanks for replying,
Yup I do. I think I started getting this error after my restricted drivers for nvidia updated to version 180, which are beta drivers. I found a link which mentions the GL missing libraries are part of the “nvidia-glx-dev” package, so now when I try to install it I get the following options:

~$ sudo apt-get install nvidia-glx-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package nvidia-glx-dev is a virtual package provided by:
  nvidia-glx-96-dev 96.43.09-0ubuntu1.1
  nvidia-glx-180-dev 180.11-0ubuntu1~intrepid1
  nvidia-glx-177-dev 177.82-0ubuntu0.1
  nvidia-glx-173-dev 173.14.12-1-0ubuntu5.1
  nvidia-glx-71-dev 71.86.04-0ubuntu10
You should explicitly select one to install.
E: Package nvidia-glx-dev has no installation candidate

So I install the version for my driver (nvidia-glx-180-dev) but I still get the error. I’ll try restarting the X server to see if anything changes :wink:

Here’s the link to the post I mention above:
http://www.linuxquestions.org/questions/linux-software-2/ubuntu-cant-build-i-get-cannot-find-lgl-error-627341/

regards, and thanks,
Alvaro F. Celis

mmmm, I just checked with the synaptic package manager and indeed I only had the mesa runtime but not the dev package “libgl1-mesa-dev”. I installed it and it marked the “nvidia-glx-180-dev” for removal, and after that blender compiled fine again! :slight_smile: thanks a lot.
I’m now going to try it with sevenblend, the script to build blender and yafaray, to see how things go.

thanks a lot.

It seems related to the nvidia packages to me (not the 32 libs).
Do you have a /usr/lib/libGL.so file and if it is a link does it point to something?
Does your others opengl programs run ok or is it just a compilation problem?

Indeed it seems it’s got nothing to do with the 32 bit libraries on my system. I got a libGL.so in my usr/lib folder and programs using 3d acceleration are running fine. I just tried running “glxgears” in a terminal and it’s ok.
After installing the mesa-dev package blender compiled fine. I’m now trying to build yafaray+blender which was also reporting the error, but I hope it’s fine now.

I’ll tell you how things go with blender+yafaray after installing the mesa dev package.

cheers!

It also compiled fine! great! :smiley: :smiley: :smiley:
The weird thing is that I didn’t have that library installed before and yet blender and yafaray compiled ok. May it be that blender has now got some new dependencies?

thanks Xat for your help and guidance.

Same thing happened to me on Hardy when I updated to the 177 or 173 driver. I now seem to be alternating between the nvidia glx dev and the mesa dev packages.

Whenever I find that error I switch from one dev package to the other and all is well again.

When I updated to the 180 driver I had to install nvidia-glx-dev and remove mesa-dev
No idea what causes it…

weird, and painful :wink: It should stick to a one and only library.
One thing I did notice that’s new and wasn’t used before is YASM (assembler), if you don’t have it installed your build will fail. I wonder why it’s required all of a sudden :wink:

thanks for the replies guys.

Organic, may I ask how you switch from one package to the other? Or is it just a matter of uninstalling one to install the other to see which one blender likes better? :wink:

The new ffmpeg needs it to compile assembler code which (I believe but may be wrong) was being done by gcc Or perhaps it was pre-compiled before, who knows.

Yep, just remove one, install the other and try again. No idea why it works. It took me weeks to figure it out, looking for gl related stuff in Synaptic and installing them to try.
I don’t know what I will do if it fails to fix it…

(I really must learn some dev stuff one day.)

Thanks for the update Uncle.
Organic, it just happened to me on my other machine :wink: This one’s compiling with the mesa-dev package and the other one preferred the nvidia-glx-dev package for the 180 drivers (the other pc just got updated to that version too).

funny, huh? :wink:

hmm, so its not just me then…

I wonder if it is time to consider a bug report somewhere. Question is, is it Blender, Ubuntu or Nvidia?

I know you’ll all well finished with this issue now, but I found it while searching for a solution to a similar problem, so I thought I’d post for any other wanderers.

The problem is that the nvidia-glx-180 package only provides /usr/lib/libGL.so.1 (symlinked to the real library at /usr/lib/libGL.so.180.44) This is correct as far as it goes, but the standard approach used to be to also have a symlink from /usr/lib/libGL.so to libGL.so.1. This may have changed recently, but lots of things still expect it.

The easy solution is to put the symbolic link back in. Here’s how:

cd /usr/lib
sudo ln -s libGL.so.1 libGL.so

So if you find you’re missing a shared library /usr/lib/libSomething.so but there is a /usr/lib/libSomething.so.some_version_numbers, if the version seems right and it comes from the right package, the try putting in the symlink yourself.

Hope this helps somebody.

This has been reported quite a few times, theres a note here in the troubleshooting section.
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux

Excellent! Thank for posting the link on blenderartists…