Error in version 0.0.21 compilation with opengl

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
jc
Peon
Peon
Posts: 4
Joined: 03 Nov 2005, 16:25

Error in version 0.0.21 compilation with opengl

Post by jc »

Code: Select all

if g++ -DHAVE_CONFIG_H -I. -I. -I..  -DTMW_DATADIR=\""/usr/local/share/tmw/"\"   -Wall -Werror -DUSE_OPENGL -I/usr/include/SDL -D_REENTRANT `pkg-config --cflags libxml-2.0`  -g -O2 -MT tmw-gui.o -MD -MP -MF ".deps/tmw-gui.Tpo" -c -o tmw-gui.o `test -f 'gui/gui.cpp' || echo './'`gui/gui.cpp; \
        then mv -f ".deps/tmw-gui.Tpo" ".deps/tmw-gui.Po"; else rm -f ".deps/tmw-gui.Tpo"; exit 1; fi
In file included from gui/../resources/image.h:29,
                 from gui/gui.cpp:55:
/usr/include/SDL/SDL_opengl.h:112:1: error: "GL_GLEXT_VERSION" redefined
In file included from /usr/include/GL/gl.h:1630,
                 from /usr/local/include/guichan/opengl/openglimage.hpp:68,
                 from /usr/local/include/guichan/opengl/openglsdlimageloader.hpp:63,
                 from gui/../resources/openglsdlimageloader.h:29,
                 from gui/gui.cpp:34:
/usr/include/GL/glext.h:74:1: error: this is the location of the previous definition
make[2]: ** [tmw-gui.o] Erro 1
The game compiles without problems using default configs... then when i enable opengl support i get no errors from ./configure but while making i get that error... anyone has an idea of the cause of this?
User avatar
Platyna
Grand Knight
Grand Knight
Posts: 2215
Joined: 19 Nov 2005, 13:19
Location: Poland
Contact:

Post by Platyna »

What GCC version?

Regards.
Daytripper
Peon
Peon
Posts: 6
Joined: 04 Sep 2006, 22:53

Post by Daytripper »

I get the same error with gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5).
Alderan
Novice
Novice
Posts: 59
Joined: 24 Jan 2006, 22:22
Location: Prague - Czech Republic

Post by Alderan »

I had same problem. They (developers) told that there is a patch for it - the patch is one line of code. But they refused to put it to sources of tmw - they told it isn't problem of game sources. (I think it is but I'm not a developer of this game)
Anyway link to that thread (it includes the solution) is
http://forums.themanaworld.org/viewtopic.php?t=1835
Master Ar2ro
Peon
Peon
Posts: 37
Joined: 21 Jan 2006, 10:59
Location: Poland, Earth
Contact:

Post by Master Ar2ro »

Alderan: It's not the problem with the game sources, but the libraries you're using most probably. I had the same error until I compiled myself the latest SDL libraries sources, since then it works fine and this error no longer appears, and I didn't have to change any line in the game's source.
C/C++,Java,PHP+MySQL - read more
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

Indeed the error is caused by using SDL versions prior to 1.2.11, again it was not TMW fault, but SDL one so there is no meaning in adding a patch to our code to fix their problems.
Alderan
Novice
Novice
Posts: 59
Joined: 24 Jan 2006, 22:22
Location: Prague - Czech Republic

Post by Alderan »

ElvenProgrammer wrote:Indeed the error is caused by using SDL versions prior to 1.2.11, again it was not TMW fault, but SDL one so there is no meaning in adding a patch to our code to fix their problems.
I have to disagree since I have 1.2.11 and it doesn't compile without the patch. Yes, I have the debian distribution version and not compiled myself. I think that sources should be compilable against differently configurated library - not only "--with-this_feature --without-that_feature". It just makes users unhappy and makes complications. That is what I think about it.
User avatar
Platyna
Grand Knight
Grand Knight
Posts: 2215
Joined: 19 Nov 2005, 13:19
Location: Poland
Contact:

Post by Platyna »

Maybe problem is GCC 4.x treats warnings as errors. Remove -Werror and from the CFLAGS.

Regards.
User avatar
Bjørn
Manasource
Manasource
Posts: 1438
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn »

Platyna wrote:Maybe problem is GCC 4.x treats warnings as errors. Remove -Werror and from the CFLAGS.

Regards.
As far as I know a redefinition is always an error. This problem happens because SDL tries to be smart about defining some OpenGL constants when glext.h wasn't included. However it fails to be smart enough apparently. I also believe this is not a problem with our code, adding the define as is done in that patch looks more like a hack to me, with the potential to break on systems that really do lack the glext.h file.
User avatar
Platyna
Grand Knight
Grand Knight
Posts: 2215
Joined: 19 Nov 2005, 13:19
Location: Poland
Contact:

Post by Platyna »

It is not always an error. You may check by Googling.

Regards.
Post Reply