-   Linux - Software (
-   -   Ubuntu can't build, I get "cannot find -lGL" error (

xmrkite 03-11-2008 04:23 PM

Ubuntu can't build, I get "cannot find -lGL" error
Hello. I'm trying to build mythtv. I am getting the following error during the "make" process:

/usr/bin/ld: cannot find -lGL

I've installed all kinds of dependencies and packages and now just don't know what to do.

Ubuntu 7.04 desktop is the os.

Does anyone have any ideas what this means? I googled it and found next to nothing except for a couple of guys saying install so and so package which i did.


acid_kewpie 03-11-2008 04:46 PM

well it's after the OpenGL library, and to compile against it you need to headers for it. for just mesaGL, install libgl-dev and you should be ok, but are you not aware that mythtv is in apt under ubuntu? no need to compile anything yourself... "sudo apt-get install mythtv"

xmrkite 03-11-2008 05:19 PM

OK, I tried apt-get install libgl-dev, but it says:


Package libgl-dev is a virtual package provided by:
  libgl1-mesa-swx11-dev 6.5.2-3ubuntu8
  libgl1-mesa-dev 6.5.2-3ubuntu8
You should explicitly select one to install.
E: Package libgl-dev has no installation candidate

i tried an apt-get install libgl1-mesa-dev, but it is already installed.

Upon trying atp-get install libgl1-mesa-swx11-dev, i got this:


The following extra packages will be installed:
The following packages will be REMOVED:
  libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libgl1-mesa-glx-dbg
  nvidia-glx ubuntu-desktop xorg
The following NEW packages will be installed:
  libgl1-mesa-swx11 libgl1-mesa-swx11-dev
0 upgraded, 2 newly installed, 7 to remove and 99 not upgraded.
Need to get 1961kB of archives.
After unpacking 49.2MB disk space will be freed.
Do you want to continue [Y/n]?

That doesn't look good to me. i don't want to remove that stuff.

Any ideas?

The main reason i'm trying to build it myself is to learn how to do linux builds, also, i want to run the svn version of mythtv.

berbae 03-12-2008 08:42 AM


/usr/bin/ld: cannot find -lGL
This message means that ld needs the library.
It is provided by the nvidia-glx-dev package.
As I see you already have the nvidia-glx package installed, you only need to add the nvidia-glx-dev package to get the needed file.
I hope that it will be enough to build mythtv.

xmrkite 03-12-2008 10:18 AM

Very Odd...

I tried a "sudo apt-get install nvidia-glx-dev"

And got this message:


Unpacking nvidia-glx-dev (from .../nvidia-glx-dev_1%3a1.0.9631+ ...
dpkg-divert: `diversion of /usr/lib/ to /usr/lib/nvidia/ by nvidia-glx-dev' clashes with `diversion of /usr/lib/ to /usr/lib/nvidia/ by nvidia-glx'
dpkg: error processing /var/cache/apt/archives/nvidia-glx-dev_1%3a1.0.9631+ (--unpack):
 subprocess pre-installation script returned error exit status 2
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've never seen anything like this. What can i do?

xmrkite 03-13-2008 11:18 AM

OK, so i figured it out. Your nvidia problem pointed me in the right direction. Here's what i did:

apt-get install nvidia-glx-new


delete /usr/lib/
then run
cd /usr/lib/
sudo ln -s

Now i can compile just fine.

-Thanks again for the help

re_bound86 05-18-2008 03:26 PM

Or instead of changing files yourself, you could after you've installed

apt-get install nvidia-glx-new


apt-get install nvidia-glx-new-dev

And everything should work.



All times are GMT -5. The time now is 03:00 PM.