PDA

View Full Version : OpenGL libraries



allenm
03-23-2007, 05:40 PM
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 configure.ac I found the following which I think is what looks for the libraries:

dnl Check for opengl
MDL_HAVE_OPENGL
HAVE_OPENGL="yes"
AC_MSG_CHECKING([for GL])
if test "x$have_GL" != "xyes"; then
AC_MSG_RESULT([no])
HAVE_OPENGL="no"
else
AC_MSG_RESULT([yes])
fi
AC_MSG_CHECKING([for GLU])
if test "x$have_GLU" != "xyes"; then
AC_MSG_RESULT([no])
HAVE_OPENGL="no"
else
AC_MSG_RESULT([yes])
fi
AC_MSG_CHECKING([for glut])
if test "x$have_glut" != "xyes"; then
AC_MSG_RESULT([no])
HAVE_OPENGL="no"
else
AC_MSG_RESULT([yes])
fi
if test "x$HAVE_OPENGL" != "xyes"; then
AC_MSG_ERROR([Check for OpenGL (GL,GLU,glut) failed.])
fi

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

Allen

RigidBody
03-27-2007, 02:27 AM
that's a lot of output- at first sight an error occurs because the linker cannot find libXmu.so when trying to compile conftest.c.

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

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 libXmu.so is really in that directory)

jide
03-27-2007, 03:41 AM
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).

allenm
03-28-2007, 03:07 PM
RigidBody - libXmu.so 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.

RigidBody
03-28-2007, 11:54 PM
shame on me- it should be

alias gcc 'gcc -L/usr/lib'

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

jide
03-29-2007, 06:06 AM
I generally use both directories:

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

in that way you generally are not missing anything.

allenm
03-30-2007, 01:11 PM
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.

jide
03-31-2007, 03:55 AM
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

??

allenm
04-07-2007, 07:50 PM
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.