Page 1 of 1

Error when compiling against Mesa 10.0

PostPosted: 14 Dec 2013, 11:13
by zezinho
While rebuilding STK for Mageia 4, I tried to include glxext.h to fix Mesa 10 changes :
{l Code}: {l Select All Code}
--- lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h.old  2013-12-14 09:47:43.628918977 +0100
+++ lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h      2013-12-14 09:49:47.982028315 +0100
@@ -60,6 +60,7 @@
        #endif
        #include <GL/gl.h>
        #include <GL/glx.h>
+       #include <GL/glxext.h>
        #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
        #include "glext.h"
        #undef GLX_ARB_get_proc_address // avoid problems with local glxext.h


But it still fails :

{l Code}: {l Select All Code}
In file included from COpenGLDriver.h:25:0,
                 from COpenGLNormalMapRenderer.cpp:13:
COpenGLExtensionHandler.h:1238:3: error: ‘PFNGLBLENDEQUATIONPROC’ does not name a type
   PFNGLBLENDEQUATIONPROC pGlBlendEquation;
   ^
COpenGLExtensionHandler.h: In member function ‘void irr::video::COpenGLExtensionHandler::extGlBlendEquation(GLenum)’:
COpenGLExtensionHandler.h:2572:6: error: ‘pGlBlendEquation’ was not declared in this scope
  if (pGlBlendEquation)
      ^
<builtin>: recipe for target 'COpenGLNormalMapRenderer.o' failed
make: *** [COpenGLNormalMapRenderer.o] Error 1
make: ** Esperando que outros processos terminem.
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -fexpensive-optimizations -O3 -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o CSceneNodeAnimatorTexture.o CSceneNodeAnimatorTexture.cpp
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -fexpensive-optimizations -O3 -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o COpenGLDriver.o COpenGLDriver.cpp
In file included from COpenGLDriver.h:25:0,
                 from COpenGLDriver.cpp:5:
COpenGLExtensionHandler.h:1238:3: error: ‘PFNGLBLENDEQUATIONPROC’ does not name a type
   PFNGLBLENDEQUATIONPROC pGlBlendEquation;
   ^
COpenGLExtensionHandler.h: In member function ‘void irr::video::COpenGLExtensionHandler::extGlBlendEquation(GLenum)’:
COpenGLExtensionHandler.h:2572:6: error: ‘pGlBlendEquation’ was not declared in this scope
  if (pGlBlendEquation)
      ^
<builtin>: recipe for target 'COpenGLDriver.o' failed
make: *** [COpenGLDriver.o] Error 1
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -fexpensive-optimizations -O3 -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o CNullDriver.o CNullDriver.cpp
erro: Código de saída inválido do /var/tmp/rpm-tmp.SLAygc (%build)

Re: Error when compiling against Mesa 10.0

PostPosted: 14 Dec 2013, 15:18
by kosmi
That is known problem, seems like those headers are curently broken upstream (from khronos):

http://lists.freedesktop.org/archives/m ... 50173.html
http://lists.freedesktop.org/archives/m ... 50177.html

Re: Error when compiling against Mesa 10.0

PostPosted: 16 Dec 2013, 09:29
by zezinho
That's the point : the headers fixed by Mesa need some fixes in STK code...

Re: Error when compiling against Mesa 10.0

PostPosted: 13 Jan 2014, 22:48
by MCMic
Same problem here, I get the exact same error.

Re: Error when compiling against Mesa 10.0

PostPosted: 15 Jan 2014, 20:58
by MCMic
I fixed the problem by deleting glext.h and symlining the system one instead.
But now I get an error from /usr/include/fribidi/fribidi-common.h about not finding glib.h.
I have the following glib.h : /usr/include/glib-2.0/glib.h

Any ideas?

Re: Error when compiling against Mesa 10.0

PostPosted: 16 Jan 2014, 01:05
by vlj
I'm aware of the issue.

You can fix it by adding this line before #include "glext.h" in CIrrDeviceLinux.h/cpp :

"typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);"
I will come with a proper solution a bit later.

Re: Error when compiling against Mesa 10.0

PostPosted: 19 Feb 2014, 17:59
by Toams
any progress on this? I need latest mesa for another game and i like testing latest stk from git. but applying this fix every time git updates is a bit annoying.

Re: Error when compiling against Mesa 10.0

PostPosted: 20 Feb 2014, 17:19
by vlj
It's theorically fixed, I have mesa (git) on my system and I can build vanilla git stk.

PostPosted: 22 Feb 2014, 11:53
by Toams
Ok then maybe something else is eating my kittens!

to make sure i'm on the latest and greatest i did the following(please correct me if i did something wrong)
{l Code}: {l Select All Code}
# git reset --hard
# git pull
# cd cmake_build/
# make clean
# cmake ../
# make -j5

but it failes with following error:
{l Code}: {l Select All Code}
[ 23%] Building CXX object lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CParticleRotationAffector.cpp.o             
In file included from /home/tommi/Code/stk/stk-code/lib/irrlicht/source/Irrlicht/COpenGLDriver.h:25:0,
                 from /home/tommi/Code/stk/stk-code/lib/irrlicht/source/Irrlicht/COpenGLSLMaterialRenderer.cpp:22:
/home/tommi/Code/stk/stk-code/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h:1239:3: error: ‘PFNGLBLENDEQUATIONPROC’ does not name a type
   PFNGLBLENDEQUATIONPROC pGlBlendEquation;
   ^
[ 23%] /home/tommi/Code/stk/stk-code/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h: In member function ‘void irr::video::COpenGLExtensionHandler::extGlBlendEquation(GLenum)’:
/home/tommi/Code/stk/stk-code/lib/irrlicht/source/Irrlicht/COpenGLExtensionHandler.h:2573:6: error: ‘pGlBlendEquation’ was not declared in this scope
  if (pGlBlendEquation)
      ^
Building CXX object lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CAnimatedMeshHalfLife.cpp.o
make[2]: *** [lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/COpenGLSLMaterialRenderer.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....


i'm currently using kubuntu 13.10 with the oibaf mesa drivers

Re: Error when compiling against Mesa 10.0

PostPosted: 22 Feb 2014, 19:24
by sj04736
I'm seeing the same thing as Toams on Arch Linux, with the latest released Mesa (10.0.3) library installed. It's quite possible they fixed this issue in Mesa 10.1, which will be released within the next few months.

Re: Error when compiling against Mesa 10.0

PostPosted: 23 Feb 2014, 00:32
by vlj
Btw do you have sdl devel file ?
I don't, and irrlicht does not use the same include file if sdl is included.

Re: Error when compiling against Mesa 10.0

PostPosted: 23 Feb 2014, 19:29
by sj04736
I don't see SDL anywhere in the CMake build scripts for irrlicht. If having sdl libs makes a difference, that'd be a build script bug. We shouldn't be compiling support for it if we don't want it. I do have sdl libs though: Arch packages development files with the binary package.

If we haven't already integrated something like this, can we do so?
http://pkgs.fedoraproject.org/cgit/irrl ... sa10.patch

Re: Error when compiling against Mesa 10.0

PostPosted: 27 Feb 2014, 01:52
by Auria
A tentative fix was committed for this, hopefully it should now work

Re: Error when compiling against Mesa 10.0

PostPosted: 27 Feb 2014, 02:36
by hiker
Auria {l Wrote}:A tentative fix was committed for this, hopefully it should now work

Also shaders are now off by default. We had a lot of problems with GSoC students, who were not able to run their self-compiled version (because STK would crash before a config file is created, where the shaders could be disabled).

This will of course be changed later.

Cheers,
Joerg

Re: Error when compiling against Mesa 10.0

PostPosted: 27 Feb 2014, 10:21
by WillemS
Auria {l Wrote}:A tentative fix was committed for this, hopefully it should now work


I was having the same problem, but the current Git version a686c43 still doesn't compile for me :(

However, I checked my installed Mesa version and it is 10.0.1 (which is the packaged version in my distribution, Chakra Linux). Is that not supported?

Error from make:

{l Code}: {l Select All Code}
In file included from /home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.h:26:0,
                 from /home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp:5:
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/glxext.h:664:8: fout: ‘GLXContextID’ does not name a type
 extern GLXContextID glXGetContextIDEXT (const GLXContext context);
        ^
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/glxext.h:665:54: fout: ‘GLXContextID’ has not been declared
 extern GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
                                                      ^
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/glxext.h:670:22: fout: ISO C++ forbids declaration of ‘GLXContextID’ with no type [-fpermissive]
 typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
                      ^
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/glxext.h:670:22: fout: typedef ‘GLXContextID’ is initialized (use decltype instead)
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/glxext.h:670:26: fout: ‘PFNGLXGETCONTEXTIDEXTPROC’ was not declared in this scope
 typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
                          ^
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/glxext.h:671:67: fout: ‘GLXContextID’ has not been declared
 typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
                                                                   ^
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp: In memberfunctie ‘virtual bool irr::CIrrDeviceLinux::run()’:
/home/willem/SuperTuxKart/stk-code/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp:1087:50: let op: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
      irrevent.KeyInput.Char = ((wchar_t*)(buf))[0];
                                                  ^
make[2]: *** [lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CIrrDeviceLinux.cpp.o] Fout 1