OpenGL libraries

I’m trying to get a computer vision system that uses OpenGL working and I’m stuck at the requirement for OpenGL libraries. I can’t figure out what libraries I need for the compile and the documentation doesn’t list the libraries. I’m running Ubuntu and the vision system’s name is Hornetseye.

When I run the configure I get the following error:

checking for OpenGL… yes
checking for GL… no
checking for GLU… no
checking for glut… no
configure: error: Check for OpenGL (GL,GLU,glut) failed.

When I took a look at config.log I found the following:

                     || test ! -s conftest.err

configure:21973: ? = 0 configure:21976: test -s conftest configure:21979: ? = 0
configure:21992: result: yes
configure:22013: checking for OpenGL
configure:22070: checking for library containing glAccum
configure:22100: gcc -o conftest -g -O2 conftest.c -lSM -lICE -lX11 -lXext -lXmu -lXt -lXi >&5
/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
configure:22106: $? = 1
configure: failed program was:
| /* confdefs.h. */

In I found the following which I think is what looks for the libraries:

dnl Check for opengl
if test “x$have_GL” != “xyes”; then
if test “x$have_GLU” != “xyes”; then
AC_MSG_CHECKING([for glut])
if test “x$have_glut” != “xyes”; then
if test “x$HAVE_OPENGL” != “xyes”; then
AC_MSG_ERROR([Check for OpenGL (GL,GLU,glut) failed.])

But, like I wrote above, I’m not sure what to load because I can’t puzzle out what the ./confgure wants.


that’s a lot of output- at first sight an error occurs because the linker cannot find when trying to compile conftest.c.

check if is installed on your system; it is probably in /usr/X11R6/lib/

if the error still occurs because libXmu cannot be found, you may have to change an include path variable in the makefile, or easier: make an alias to gcc like

alias gcc ‘gcc -I/usr/X11R6/lib’

(assuming that the is really in that directory)

It also seems your GL libraries are missing.

Try an ‘apt-get install freeglut’ and an ‘apt-get install freeglut-devel’.
If it can’t find it, then use aptitude and look for them (the GL libraries should be called Mesa).

RigidBody - is in /usr/lib but the alias command didn’t do anything noticeable. Thanks for trying.

jide - I love aptitude. Quicker then synaptic and easier to use then apt-get but if there’s a GL library missing I can’t see it. Aptitude reports that GL, Glu, Glut are all there. Thanks to you as well.

shame on me- it should be

alias gcc ‘gcc -L/usr/lib’

-L defines the library path, -I the include path. my apologies…

I generally use both directories:

gcc xxxx -L /usr/lib -L /usr/X11R6/lib yyy

in that way you generally are not missing anything.

Thanks guys but no change.

I think there may be a bug in one of the .m4 files. There’s a macro - mdl_have_opengl.m4 - that’s supposed to look up the OpenGL libraries which might be causing the problem. Maybe.

So avoid it ! I don’t like to use many of such macros. They change often, new releases of automake can’t ensure they will still work…

Did you tried out a simple line just like this one ?

gcc my_program.c -o my_program -L /usr/X11R6/lib -lglut -lGLU -lGL -lXmu


Thanks for your help guys.

I’ve got the system working now. All it took was for the developer to look at his code and notice a call that he’d planned to take out but didn’t.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.