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, 17:25

Error in version 0.0.21 compilation with opengl

Post by jc » 23 Sep 2006, 20:14

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
Former Dictator
Former Dictator
Posts: 2213
Joined: 19 Nov 2005, 14:19
Location: Poland
Contact:

Post by Platyna » 23 Sep 2006, 21:30

What GCC version?

Regards.
Zuzanna K. Filutowska
[The rest of this signature was censored by TMWC's "Freedom" and "Free speech".]
Daytripper
Peon
Peon
Posts: 6
Joined: 04 Sep 2006, 23:53

Post by Daytripper » 24 Sep 2006, 06:55

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

Post by Alderan » 24 Sep 2006, 09:29

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, 11:59
Location: Poland, Earth
Contact:

Post by Master Ar2ro » 24 Sep 2006, 10:10

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
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 24 Sep 2006, 10:45

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
Peon
Peon
Posts: 59
Joined: 24 Jan 2006, 23:22
Location: Prague - Czech Republic
Contact:

Post by Alderan » 24 Sep 2006, 11:19

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
Former Dictator
Former Dictator
Posts: 2213
Joined: 19 Nov 2005, 14:19
Location: Poland
Contact:

Post by Platyna » 24 Sep 2006, 13:46

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

Regards.
Zuzanna K. Filutowska
[The rest of this signature was censored by TMWC's "Freedom" and "Free speech".]
User avatar
Bjørn
TMW Adviser
TMW Adviser
Posts: 1430
Joined: 09 Dec 2004, 19:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn » 24 Sep 2006, 15:40

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
Former Dictator
Former Dictator
Posts: 2213
Joined: 19 Nov 2005, 14:19
Location: Poland
Contact:

Post by Platyna » 24 Sep 2006, 15:43

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

Regards.
Zuzanna K. Filutowska
[The rest of this signature was censored by TMWC's "Freedom" and "Free speech".]
Post Reply