Fixed: OpenFrameworks 0.9.0 cannot find libGL

openFrameworks

It’s been a while since I last used the OpenFrameworks framework to do some 3D on my Ubuntu Linux.

Actually, the last time I used it was a few OF versions back and not even on the same computer, nor the same Ubuntu version.

I then felt quite lost when, after having downloaded the latest OF version (currently 0.9.0) on my system (currently an Ubuntu 14.04 « Trusty Tahr » LTS), I couldn’t even compile the simplest of projects (may it be the « emptyExample » in the OF myApps folder, a project I created myself, or one of the bundled example projects), because the linker couldn’t link against the « libGL » library, as the given error message tried to point:

1
2
3
4
5
6
7
8
# In a directory where an OF project can be compiled with its Makefile just by typing make, e.g. "/home/baron_a/Projects/of_v0.9.0_linux64_release/apps/myApps/emptyExample"...

make

# ...yadda yadda lots of compiler outputs...

/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status

So I of course tried to find what was wrong, and this question on the openFrameworks forum gave me an hint: the problem seems to come from the version number appended to the libGL library filename. I have a file called « libGL.so.1  » in my /usr/lib directory, and that’s the library file OF programs should link against, but just because of this pesky « .1  » at the end of the filename, it seems Makefiles can’t find it anymore.

Anyway, since paths where this kind of system libs can greatly vary from a Linux distro to another, I couldn’t directly use the fix provided by the author of this thread, since my libGL.so file was elsewhere, but the idea stays the same : create a symbolic link on this library file, omitting the library version number in its filename.

As a matter of fact, I found out that the problematic /usr/lib/libGL.so.1 file was itself already (hold on to your hats!) a symbolic link pointing to a symbolic link (/usr/lib/libGL.so.1 -> /usr/lib/x86_64-linux-gnu/libGL.so.1) pointing to the real library file (/usr/lib/x86_64-linux-gnu/libGL.so.1 -> libGL.so.346.72), located in /usr/lib/x86_64-linux-gnu/libGL.so.346.72 !

So the fix for me was, again on an Ubuntu 14.04 « Trusty Tahr » LTS :

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

But I guess I could make it point directly to the « true » library file and it would work just fine too.

And now I can make and run my OF projects properly !

One less problem to deal with. 🙂

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée.