Page 1 of 1

Error in version 0.0.21 compilation with opengl

Posted: 23 Sep 2006, 19:14
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?

Posted: 23 Sep 2006, 20:30
by Platyna
What GCC version?

Regards.

Posted: 24 Sep 2006, 05:55
by Daytripper
I get the same error with gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5).

Posted: 24 Sep 2006, 08:29
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

Posted: 24 Sep 2006, 09:10
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.

Posted: 24 Sep 2006, 09:45
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.

Posted: 24 Sep 2006, 10:19
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.

Posted: 24 Sep 2006, 12:46
by Platyna
Maybe problem is GCC 4.x treats warnings as errors. Remove -Werror and from the CFLAGS.

Regards.

Posted: 24 Sep 2006, 14:40
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.

Posted: 24 Sep 2006, 14:43
by Platyna
It is not always an error. You may check by Googling.

Regards.