[Fixed] Compiling Irrlicht on Linux

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
archmagus
Posts: 25
Joined: Sat May 30, 2015 4:18 am
Location: Australia

[Fixed] Compiling Irrlicht on Linux

Post by archmagus »

Hi!

I recently switched to Xubuntu 15.04 64-bit (from Debian 32-bit) and had some problems with compiling Irrlicht.

I already have all the source dependencies, I used:

Code: Select all

 
sudo apt-get build-dep irrlicht
 
And I already had the X11 dev packages for SDL.

After unzipping the Irrlicht 1.8.1 source archive (from http://irrlicht.sourceforge.net/downloads/) I simply run make -j4 in source/Irrlicht/
make gives me this error:

Code: Select all

 
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -g -D_DEBUG -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o COpenGLDriver.o COpenGLDriver.cpp
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -g -D_DEBUG -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o COpenGLNormalMapRenderer.o COpenGLNormalMapRenderer.cpp
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -g -D_DEBUG -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o COpenGLParallaxMapRenderer.o COpenGLParallaxMapRenderer.cpp
g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -g -D_DEBUG -I../../include -Izlib -Ijpeglib -Ilibpng -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1  -c -o COpenGLShaderMaterialRenderer.o COpenGLShaderMaterialRenderer.cpp
In file included from COpenGLDriver.h:25:0,
                 from COpenGLParallaxMapRenderer.cpp:9:
COpenGLExtensionHandler.h:1236:3: error: ‘PFNGLBLENDEQUATIONPROC’ does not name a type
   PFNGLBLENDEQUATIONPROC pGlBlendEquation;
   ^
In file included from COpenGLDriver.h:25:0,
                 from COpenGLShaderMaterialRenderer.cpp:13:
COpenGLExtensionHandler.h:1236:3: error: ‘PFNGLBLENDEQUATIONPROC’ does not name a type
   PFNGLBLENDEQUATIONPROC pGlBlendEquation;
   ^
COpenGLExtensionHandler.h: In member function ‘void irr::video::COpenGLExtensionHandler::extGlBlendEquation(GLenum)’:
COpenGLExtensionHandler.h:2566:6: error: ‘pGlBlendEquation’ was not declared in this scope
  if (pGlBlendEquation)
      ^
COpenGLExtensionHandler.h: In member function ‘void irr::video::COpenGLExtensionHandler::extGlBlendEquation(GLenum)’:
COpenGLExtensionHandler.h:2566:6: error: ‘pGlBlendEquation’ was not declared in this scope
  if (pGlBlendEquation)
      ^
In file included from COpenGLDriver.h:25:0,
                 from COpenGLDriver.cpp:5:
COpenGLExtensionHandler.h:1236:3: error: ‘PFNGLBLENDEQUATIONPROC’ does not name a type
   PFNGLBLENDEQUATIONPROC pGlBlendEquation;
   ^
In file included from COpenGLDriver.h:25:0,
                 from COpenGLNormalMapRenderer.cpp:13:
COpenGLExtensionHandler.h:1236:3: error: ‘PFNGLBLENDEQUATIONPROC’ does not name a type
   PFNGLBLENDEQUATIONPROC pGlBlendEquation;
   ^
COpenGLExtensionHandler.h: In member function ‘void irr::video::COpenGLExtensionHandler::extGlBlendEquation(GLenum)’:
COpenGLExtensionHandler.h:2566:6: error: ‘pGlBlendEquation’ was not declared in this scope
  if (pGlBlendEquation)
      ^
COpenGLExtensionHandler.h: In member function ‘void irr::video::COpenGLExtensionHandler::extGlBlendEquation(GLenum)’:
COpenGLExtensionHandler.h:2566:6: error: ‘pGlBlendEquation’ was not declared in this scope
  if (pGlBlendEquation)
      ^
<builtin>: recipe for target 'COpenGLParallaxMapRenderer.o' failed
make: *** [COpenGLParallaxMapRenderer.o] Error 1
make: *** Waiting for unfinished jobs....
<builtin>: recipe for target 'COpenGLShaderMaterialRenderer.o' failed
make: *** [COpenGLShaderMaterialRenderer.o] Error 1
<builtin>: recipe for target 'COpenGLNormalMapRenderer.o' failed
make: *** [COpenGLNormalMapRenderer.o] Error 1
<builtin>: recipe for target 'COpenGLDriver.o' failed
make: *** [COpenGLDriver.o] Error 1
 
So I put #undef _IRR_OPENGL_USE_EXTPOINTER_ at Line 199 of IrrCompileConfig.h:

Code: Select all

 
//! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers.
/** On some systems there is no support for the dynamic extension of OpenGL
    via function pointers such that this has to be undef'ed. */
#if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_)
#define _IRR_OPENGL_USE_EXTPOINTER_
#endif
#undef _IRR_OPENGL_USE_EXTPOINTER_
 
I then run make clean and make -j4 in source/Irrlicht/.
Irrlicht compiles fine and I have libIrrlicht.a in ../../libs/Linux.

When I buildAllExamples.sh however:

Code: Select all

 
Building 01.HelloWorld
~/devel/irrlicht-1.8.1/examples/01.HelloWorld ~/devel/irrlicht-1.8.1/examples
Makefile:51: Cleaning...
Makefile:47: Building...
g++ -I../../include -I/usr/X11R6/include  -O3 -ffast-math main.cpp -o ../../bin/Linux/01.HelloWorld -L../../lib/Linux -lIrrlicht -L/usr/X11R6/lib -lGL -lXxf86vm -lXext -lX11 -lXcursor
../../lib/Linux/libIrrlicht.a(COpenGLDriver.o): In function `irr::video::COpenGLExtensionHandler::extGlSwapInterval(int)':
/home/archmagus/devel/irrlicht-1.8.1/source/Irrlicht/COpenGLExtensionHandler.h:2540: undefined reference to `glXSwapIntervalSGI'
collect2: error: ld returned 1 exit status
Makefile:47: recipe for target 'all_linux' failed
make: *** [all_linux] Error 1
 
:x

To fix this I comment out glXSwapIntervalSGI(interval); in COpenGLExtensionHandler.h (Line 2540) and recompile Irrlicht.
Then I can compile the examples and :D everything works, or so it appears...

Have I come across a genuine bug or have I misconfigured something? Will my n00b fix break something else down the track?

I'm running Xubuntu 15.04 64-bit.
I have an Nvidia GeForce GTX 750, using driver version 346.59 from the standard Ubuntu Repo.
Last edited by archmagus on Sun May 31, 2015 1:52 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Compiling Irrlicht on Linux

Post by CuteAlien »

No, it was a bug in 1.8.1. One day I'll have a free weekend for releasing 1.8.2 *sigh*
You can also work with Irrlicht svn release branch 1.8 - that has a few bugfixes.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
archmagus
Posts: 25
Joined: Sat May 30, 2015 4:18 am
Location: Australia

[Fixed] Compiling Irrlicht on Linux

Post by archmagus »

Thanks!

I just got it from here:
https://svn.code.sf.net/p/irrlicht/code ... eases/1.8/
and it compiled without incident without any modifications!

I also tried compiling with clang++ 3.6 and that also worked :D
Post Reply