Problems building glut on Ubuntu 9.10 amd64

Hi,
I’d like to install and use the ARToolkit and I’m starting building Glut on my system.

I downloaded the latest distribution (Glut 3.7). In the root directory I give the command:

./mkmkfiles.imake

It works just fine. At least, I don’t see any error.

Then I change directory to lib/glut and:

[carlo@lloyd:lib/glut]$ make                                      (01-23 10:13)
+ mkdir unshared
rm -f glut_8x13.o unshared/glut_8x13.o
gcc -c    -I../../include    -Dlinux -D__amd64__ -D_POSIX_C_SOURCE=199309L 	-D_POSIX_SOURCE -D_XOPEN_SOURCE 				-D_BSD_SOURCE -D_SVID_SOURCE                                 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   				  -DFUNCPROTO=15 -DNARROWPROTO     	-g -O2 -fno-strict-aliasing -g  glut_8x13.c -o unshared/glut_8x13.o
In file included from glutbitmap.h:10,
                 from glut_8x13.c:5:
../../include/GL/glut.h:63:1: warning: "APIENTRY" redefined
In file included from ../../include/GL/glut.h:58,
                 from glutbitmap.h:10,
                 from glut_8x13.c:5:
/usr/include/GL/gl.h:111:1: warning: this is the location of the previous definition
rm -f glut_8x13.o
gcc -c -g -O2 -fno-strict-aliasing -g    -I../../include    -Dlinux -D__amd64__ -D_POSIX_C_SOURCE=199309L 				-D_POSIX_SOURCE -D_XOPEN_SOURCE 				-D_BSD_SOURCE -D_SVID_SOURCE                                 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 		  				  -DFUNCPROTO=15 -DNARROWPROTO        -fPIC glut_8x13.c
In file included from glutbitmap.h:10,
                 from glut_8x13.c:5:
../../include/GL/glut.h:63:1: warning: "APIENTRY" redefined
In file included from ../../include/GL/glut.h:58,
                 from glutbitmap.h:10,
                 from glut_8x13.c:5:
/usr/include/GL/gl.h:111:1: warning: this is the location of the previous definition
rm -f glut_9x15.o unshared/glut_9x15.o
gcc -c    -I../../include    -Dlinux -D__amd64__ -D_POSIX_C_SOURCE=199309L 	-D_POSIX_SOURCE -D_XOPEN_SOURCE 				-D_BSD_SOURCE -D_SVID_SOURCE                                 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   				  -DFUNCPROTO=15 -DNARROWPROTO     	-g -O2 -fno-strict-aliasing -g  glut_9x15.c -o unshared/glut_9x15.o
In file included from glutbitmap.h:10,
                 from glut_9x15.c:5:
../../include/GL/glut.h:63:1: warning: "APIENTRY" redefined
In file included from ../../include/GL/glut.h:58,
                 from glutbitmap.h:10,
                 from glut_9x15.c:5:
/usr/include/GL/gl.h:111:1: warning: this is the location of the previous definition
rm -f glut_9x15.o
gcc -c -g -O2 -fno-strict-aliasing -g    -I../../include    -Dlinux -D__amd64__ -D_POSIX_C_SOURCE=199309L 
...
...
...
fno-strict-aliasing -g  glut_cmap.c -o unshared/glut_cmap.o
glut_cmap.c:18:66: error: X11/Xmu/StdCmap.h: No such file or directory
In file included from glutint.h:25,
                 from glut_cmap.c:30:
../../include/GL/glut.h:63:1: warning: "APIENTRY" redefined
In file included from /usr/include/GL/glx.h:45,
                 from glutint.h:22,
                 from glut_cmap.c:30:
/usr/include/GL/gl.h:111:1: warning: this is the location of the previous definition
make: *** [glut_cmap.o] Error 1

I tried using "make depend and then again "make:

making all in lib/glut...
make[1]: Entering directory `/home/carlo/ordinami/glut-3.7/lib/glut'
rm -f glut_cmap.o unshared/glut_cmap.o
gcc -c    -I../../include    -Dlinux -D__amd64__ -D_POSIX_C_SOURCE=199309L 	-D_POSIX_SOURCE -D_XOPEN_SOURCE 				-D_BSD_SOURCE -D_SVID_SOURCE                                 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   				  -DFUNCPROTO=15 -DNARROWPROTO     	-g -O2 -fno-strict-aliasing -g  glut_cmap.c -o unshared/glut_cmap.o
glut_cmap.c:18:66: error: X11/Xmu/StdCmap.h: No such file or directory
In file included from glutint.h:25,
                 from glut_cmap.c:30:
../../include/GL/glut.h:63:1: warning: "APIENTRY" redefined
In file included from /usr/include/GL/glx.h:45,
                 from glutint.h:22,
                 from glut_cmap.c:30:
/usr/include/GL/gl.h:111:1: warning: this is the location of the previous definition
make[1]: *** [glut_cmap.o] Error 1
make[1]: Leaving directory `/home/carlo/ordinami/glut-3.7/lib/glut'
make: *** [all] Error 2

What can I do?
In some other thread I read to install the glutg3-dev package. I did it, but didn’t solve.

Thanks for your help.

Since you are on Ubuntu you should not need to download the source and compile GLUT 3.7 at all manually. In ubuntu just install glut3, glut3-dev and libglut3 via synaptic or apt-get command. This will give you correct GLUT functionality ie headers and libraries installed. Note this will NOT help you compile the old outdated GLUT 3.7 not supported since 1998 … rather Ubuntu uses Freeglut for a drop in replacement of GLUT 3.7.

ps. If you really really want to compile GLUT (not necessary unless you want the most recent version for GL3 help thru new glutInitContextVersion() and glutInitContextFlags() calls and Ubuntu hasn’t caught up with it yet) get the source from the freeglut project and you will not have these compile errors.

Thanks, this worked.

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