Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74139 - GLTron compile problem
Summary: GLTron compile problem
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-11 14:45 UTC by will
Modified: 2004-12-11 17:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description will 2004-12-11 14:45:33 UTC
I tried to compile GLTron and it failed. Here is the output:
depmode=gcc3 /bin/sh ../../depcomp \
i686-pc-linux-gnu-gcc -DPACKAGE=\"gltron\" -DVERSION=\"0.70\" -DHAVE_LIBGL=1 -DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBSMPEG=1 -DHAVE_LIBOGG=1 -DHAVE_LIBVORBIS=1 -DHAVE_LIBVORBISFILE=1 -DHAVE_LIBSMPEG=1 -DHAVE_LIBMIKMOD=1 -DHAVE_UNISTD_H=1 -DHAVE_GL_GL_H=1 -Dconst= -DHAVE_MKSTEMP=1  -I. -I.   -DDATA_DIR=\"/usr/share/games/gltron\" -DSNAP_DIR=\"~\" -DPREF_DIR=\"~\" -I../../nebu/include -I../../src/include -I../../lua/include -DSEPARATOR="'/'" -Wall -Werror -Os -I/usr/include/SDL -D_REENTRANT -c `test -f scripting_interface.c || echo './'`scripting_interface.c
globals.c:101:1: "GL_CLAMP_TO_EDGE" redefined
In file included from /usr/include/SDL/SDL_opengl.h:44,
                 from ../../src/include/video/model.h:16,
                 from ../../src/include/video/video.h:6,
                 from globals.c:2:
/usr/include/GL/gl.h:1075:1: this is the location of the previous definition
make[2]: *** [globals.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/gltron-0.70/work/gltron-0.70/src/game'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gltron-0.70/work/gltron-0.70/src'
make: *** [all-recursive] Error 1

!!! ERROR: games-action/gltron-0.70 failed.
!!! Function games_src_compile, Line 143, Exitcode 2
!!! emake failed
!!! If you need support, post the topmost build error, NOT this status message.

I found an edit to the source that will make it compile. It worked for me. I don't know how to make patches, so if someone would turn this into a patch and apply it to the source in an ebuild that would be nice.

http://www.gltron.org/faq-update.php
*********************************
 Question:  Hi, great game. I've build it on Linux (gentoo) an run into a compiler error: globals.c:101:1: "GL_CLAMP_TO_EDGE" redefined In file included from /usr/include/SDL/SDL_opengl.h:44, from ../../src/include/video/model.h:16, from ../../src/include/video/video.h:6, from globals.c:2: /usr/include/GL/gl.h:1075:1: this is the location of the previous definition m gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)

Answer: I fixed this this way: Replace in globals.c, line 101 #ifndef GL_VERSION_1_2 # define GL_CLAMP_TO_EDGE GL_CLAMP #endif with #ifndef GL_VERSION_1_2 # ifndef GL_CLAMP_TO_EDGE # define GL_CLAMP_TO_EDGE GL_CLAMP # endif #endif I don't know whether this way GL_CLAMP_TO_EDGE can happen to hold the wrong value or not, but it works for me.
Contributed by Klaus H
Comment 1 will 2004-12-11 14:45:33 UTC
I tried to compile GLTron and it failed. Here is the output:
depmode=gcc3 /bin/sh ../../depcomp \
i686-pc-linux-gnu-gcc -DPACKAGE=\"gltron\" -DVERSION=\"0.70\" -DHAVE_LIBGL=1 -DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBSMPEG=1 -DHAVE_LIBOGG=1 -DHAVE_LIBVORBIS=1 -DHAVE_LIBVORBISFILE=1 -DHAVE_LIBSMPEG=1 -DHAVE_LIBMIKMOD=1 -DHAVE_UNISTD_H=1 -DHAVE_GL_GL_H=1 -Dconst= -DHAVE_MKSTEMP=1  -I. -I.   -DDATA_DIR=\"/usr/share/games/gltron\" -DSNAP_DIR=\"~\" -DPREF_DIR=\"~\" -I../../nebu/include -I../../src/include -I../../lua/include -DSEPARATOR="'/'" -Wall -Werror -Os -I/usr/include/SDL -D_REENTRANT -c `test -f scripting_interface.c || echo './'`scripting_interface.c
globals.c:101:1: "GL_CLAMP_TO_EDGE" redefined
In file included from /usr/include/SDL/SDL_opengl.h:44,
                 from ../../src/include/video/model.h:16,
                 from ../../src/include/video/video.h:6,
                 from globals.c:2:
/usr/include/GL/gl.h:1075:1: this is the location of the previous definition
make[2]: *** [globals.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/gltron-0.70/work/gltron-0.70/src/game'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gltron-0.70/work/gltron-0.70/src'
make: *** [all-recursive] Error 1

!!! ERROR: games-action/gltron-0.70 failed.
!!! Function games_src_compile, Line 143, Exitcode 2
!!! emake failed
!!! If you need support, post the topmost build error, NOT this status message.

I found an edit to the source that will make it compile. It worked for me. I don't know how to make patches, so if someone would turn this into a patch and apply it to the source in an ebuild that would be nice.

http://www.gltron.org/faq-update.php
*********************************
 Question:  Hi, great game. I've build it on Linux (gentoo) an run into a compiler error: globals.c:101:1: "GL_CLAMP_TO_EDGE" redefined In file included from /usr/include/SDL/SDL_opengl.h:44, from ../../src/include/video/model.h:16, from ../../src/include/video/video.h:6, from globals.c:2: /usr/include/GL/gl.h:1075:1: this is the location of the previous definition m gcc version 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)

Answer: I fixed this this way: Replace in globals.c, line 101 #ifndef GL_VERSION_1_2 # define GL_CLAMP_TO_EDGE GL_CLAMP #endif with #ifndef GL_VERSION_1_2 # ifndef GL_CLAMP_TO_EDGE # define GL_CLAMP_TO_EDGE GL_CLAMP # endif #endif I don't know whether this way GL_CLAMP_TO_EDGE can happen to hold the wrong value or not, but it works for me.
Contributed by Klaus Häming ( khaeming [aT) web . de ) 
*********************************************************
here is my emerge info:
Portage 2.0.51-r8 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.9-nitro4 i686)
=================================================================
System uname: 2.6.9-nitro4 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System version 1.6.7
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Aug 10 2004, 19:27:10)]
distcc 2.18.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.8.5-r2, 1.6.3, 1.9.3, 1.5, 1.7.9
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.2-r7
virtual/os-headers:  2.6.8.1-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig candy ccache distlocks prelink sfperms"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/bmg-main /usr/local/fluidportage/trunk /usr/local/mycvsebuilds /usr/local/kde-metaebuilds/trunk"
SYNC="rsync://Greek/gentoo-portage"
USE="3dfx 3dnow 3dnowex X aalib aim alsa apm asserts avi beepmp berkdb bidi bitmap-fonts bmp bonobo cdparanoia cdr compositor crypt cups curl dba deskmenu dga directfb divx4linux dmx dvd dvdread edl encode erandom escreen esd etwin evo extendedprefs extrastuff f77 fam fbcon filter flac flash foomaticdb fortran gb gcov gd gdbm ggi gif gimpprint gnome gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile icq imagemagick imlib ipv6 jabber jack java javascript jikes joystick jpeg ldap letter libcaca libg++ libwww live lzo mad maildir matroska matrox mbox menu mikmod mmx mmx2 mng motif mpeg msn mysql ncurses network nls nntp no_wxgtk1 nodroproot nptl nptlonly nvidia odbc oggvorbis openal opengl oscar oss pam panel panelplugin pdflib perl png ppds profiling python quicktime randr readline real rtc samba scanner scrambledir sdl slang slp speex spell sse ssl svg svga szip tcltk tcpd tga theora tiff truetype usb userlocales v4l v4l2 vidoes wmf wxwindows x86 xanim xml xml2 xprint xv xvid xvmc yahoo zlib"
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2004-12-11 16:49:07 UTC
What are you using for opengl?  Try a remerge and opengl-update and see if that makes a difference please.
Comment 3 will 2004-12-11 17:14:06 UTC
I am using the binary nvidia drivers, nvidia-kernel and nvidia-glx. After a recompile of nvidia-glx and opengl-update nvidia it compiled. Should the patch still be put in for others so that no one else gets this compile prob?
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2004-12-11 17:21:37 UTC
No, if it compiles fine for you after the remerge there's no point it adding the patch since it is a work around.  Marking fixed.