Error building on Ubuntu 10.04

lvella
Posts: 16
Joined: Thu Oct 30, 2008 4:28 pm

Error building on Ubuntu 10.04

Post by lvella »

With every dependency (mesa, glut, cmake) installed from default Ubuntu repository, I get this tragic outcome:

$ make
[ 4%] Built target OpenGLSupport
[ 34%] Built target BulletCollision
[ 35%] Built target BulletFileLoader
[ 35%] Built target BulletWorldImporter
[ 40%] Built target ConvexDecomposition
[ 40%] Built target GIMPACTUtils
[ 51%] Built target GLUI
[ 57%] Built target BulletMultiThreaded
[ 64%] Built target BulletDynamics
[ 67%] Built target BulletSoftBody
[ 69%] Built target LinearMath
Linking CXX executable AppAllBulletDemos
/usr/bin/ld: cannot find -lopengl32
collect2: ld returned 1 exit status
make[2]: ** [Demos/AllBulletDemos/AppAllBulletDemos] Erro 1
make[1]: ** [Demos/AllBulletDemos/CMakeFiles/AppAllBulletDemos.dir/all] Erro 2
make: ** [all] Erro 2

Same thing with 2.76 and 2.77-r2142 (the one packaged for download as ALPHA). I would find it funny if not rather tragic that this bug was not spotted sooner, it makes me feel that Linux game programming is an extremely solitary path... :(
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: Error building on Ubuntu 10.04

Post by Dragonlord »

Something is broken with the make file generator. OpenGL32.dll is a windows library. Under Posix this is called plain libopengl.so hence you need to link with -lopenl without 32.
lvella
Posts: 16
Joined: Thu Oct 30, 2008 4:28 pm

Re: Error building on Ubuntu 10.04

Post by lvella »

Actually it is -lGL under Linux.

Sorry, my mistake. I just found that, although the mesa-dev package was installed, the headers were somehow deleted. So cmake was not able to find the system wide OpenGL, falling back to opengl32.

Anyway, I still think this is a bug, because there should be no fallback to opengl32 on Linux (and possibly on MacOS, but I am not sure).