Page 1 of 1

Tip to compile Irrlicht in linux

Posted: Mon Feb 20, 2006 9:43 pm
by mandrav
The source/source.txt file that describes how to build irrlicht in linux, mentions two ways to fix the linker error about glXGetProcAddress.

Well, both ways are ugly, if I may say so.
The first disables OpenGL extensions. Not good. Use it only as a last resort...
The second requires a lot of search & replace from the user. Not good either.

In these situations, it is more comfortable to use a quick'n'dirty hack to get the job done.
Here it goes:

1) Edit source/Irrlicht/Makefile
2) Find the line that starts with CXXINCS:

Code: Select all

CXXINCS = -I"include/" -I"zlib/"
3) Change it like so:

Code: Select all

CXXINCS = -DglXGetProcAddress=glXGetProcAddressARB -I"include/" -I"zlib/"
4) Run make and enjoy :)

Basically, all we do is we 're using the preprocessor to our advantage. We 're asking it to replace for us all occurrences of glXGetProcAddress with glXGetProcAddressARB.

One small note about glXGetProcAddress:
The NVidia drivers export glXGetProcAddressARB (hence this fix). It might be possible though, that some other drivers export glXGetProcAddressEXT. So if you still get linker errors, try substituting glXGetProcAddressARB with glXGetProcAddressEXT and retry. You might get lucky ;)

HTH someone,
Yiannis.

Posted: Tue Feb 21, 2006 2:43 pm
by finger007
Hi Yiannis,

thanks a lot - this is really helpful!
I'll definitely try it.

Cheers,
Alex

Posted: Tue Feb 21, 2006 5:04 pm
by afecelis
great tip! Thnx Mandrav. I'll try it out. I'm making this thread sticky.

Debian / Ubuntu Dependencies

Posted: Wed Mar 08, 2006 9:33 pm
by blackmangoes
I found it helpful to do

apt-get install libgl1-mesa-dev libglu1-mesa-dev libx11-dev x11proto-core-dev x11proto-gl-dev x11proto-kb-dev libpng12-dev zlib1g-dev x11proto-xf86vidmode-dev libxxf86vm-dev libxau-dev libxext-dev libxi-dev x11proto-input-dev x11proto-xext-dev libjpeg62-dev

Before doing make

Posted: Sun Mar 26, 2006 11:28 pm
by afecelis
thnx again Mandrav! your tip saved my butt today. I was getting some TextureClamp errors so I decided to erase my source folder and start from scratch again with your "makefile" fix, and it works nicely!

:D :D

Posted: Sun Apr 30, 2006 7:20 pm
by Nadro
I have Radeon 9550 and if i compile Irrlicht i have error:
/usr/lib/gcc/i486-linux-gnu/4.0.2/../../../../lib/libGL.a(glxext.o): In function `__glXInitialize':
: undefined reference to `drmMap'

What is wrong?

Posted: Mon Aug 07, 2006 11:13 pm
by stodge
-DglXGetProcAddress=glXGetProcAddressARB

This should go into the makefile for sure. :)

irrlicht on ubuntu 7.04

Posted: Sun May 06, 2007 12:07 am
by juantar
For ubuntu 7.04 I had to do the following to be able to compile irrlicht apps:

sudo apt-get install g++
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev libx11-dev x11proto-core-dev x11proto-gl-dev x11proto-kb-dev libpng12-dev zlib1g-dev x11proto-xf86vidmode-dev libxxf86vm-dev libxau-dev libxext-dev libxi-dev x11proto-input-dev x11proto-xext-dev libjpeg62-dev
cd /usr/lib
sudo cp libGL.so.1.0.9631 libGL.so
sudo cp libGLU.so.1.3.060502 libGLU.so
sudo cp libXxf86vm.so.1.0.0 libXxf86vm.so
sudo cp libXext.so.6.4.0 libXext.so
sudo cp libX11.so.6.2.0 libX11.so
sudo ldconfig

I did the modifications to the makefile already mentioned but also I did change some things to 2 lines in the file. The lines now look like this:



LDFLAGS = -L/usr/lib --no-export-all-symbols --add-stdcall-alias -lGLU -lGL -lXxf86vm
CXXINCS = -DglXGetProcAddress=glXGetProcAddressARB -I"../../include/" -I"zlib/" -Ijpeglib -Ilibpng #-I/usr/include/X11

For the makefiles for the samples I had to change the OPTS line into:

OPTS = -I"../../include" -I"/usr/include/X11" -L"/usr/lib" -L"../../lib/Linux" -lIrrlicht -lGL -lGLU -lXxf86vm -lXext -lX11

Posted: Sun May 06, 2007 10:50 am
by FlyingIsFun1217
On Ubuntu 7.04 w/ Radeon Mobility 9000 (M6 LY), I can compile with no makefile editing at all :)

FlyingIsFun1217

Posted: Sun May 06, 2007 11:05 am
by hybrid
That should indeed be the default for most Linux distros. Moreover, if you use apt-get and you have to add the .so links on your own there seems to be something completely wrong with your system. And even in that case you should call ldconfig instead of creating the links on your own!

Posted: Sat Jul 24, 2010 11:09 am
by paradoximo
I have stupid problem while i'm compiling source of downloaded irrlicht from svn...
check this out:

[log from Terminal]


kamil@kamil-laptop:~/irrlicht/source/Irrlicht$ make
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 CIrrDeviceLinux.o CIrrDeviceLinux.cpp
CIrrDeviceLinux.cpp:26:33: error: X11/Xcursor/Xcursor.h: No such file or directory
CIrrDeviceLinux.cpp: In member function ‘virtual bool irr::CIrrDeviceLinux::run()’:
CIrrDeviceLinux.cpp:1023: warning: dereferencing type-punned pointer will break strict-aliasing rules
CIrrDeviceLinux.cpp: In member function ‘Cursor irr::CIrrDeviceLinux::TextureToARGBCursor(irr::video::ITexture*, const irr::core::rect<int>&, const irr::core::vector2d<int>&)’:
CIrrDeviceLinux.cpp:2011: error: ‘XcursorImage’ was not declared in this scope
CIrrDeviceLinux.cpp:2011: error: ‘image’ was not declared in this scope
CIrrDeviceLinux.cpp:2011: error: ‘XcursorImageCreate’ was not declared in this scope
CIrrDeviceLinux.cpp:2020: error: ‘XcursorPixel’ was not declared in this scope
CIrrDeviceLinux.cpp:2020: error: ‘target’ was not declared in this scope
CIrrDeviceLinux.cpp:2032: error: expected ‘;’ before ‘pixelCol’
CIrrDeviceLinux.cpp:2039: error: ‘XcursorImageLoadCursor’ was not declared in this scope
CIrrDeviceLinux.cpp:2041: error: ‘XcursorImageDestroy’ was not declared in this scope
make: *** [CIrrDeviceLinux.o] Błąd 1



My version of Linux is Ubuntu 10.4...
I don't know why it isn't compiling.... few moths ago i had Ubuntu 9.10 and it compiled perfectly with no errors or something.


Help :)??

Posted: Sat Jul 24, 2010 12:22 pm
by CuteAlien
It is because in the meantime we added cursor-support into Irrlicht. And on Linux it's by default using XCursor because I wanted the Cursor-support on Linux to be as good as the one on Windows. So when you install the XCursor dev package for Ubuntu it should compile again. Alternatively you can disable _IRR_LINUX_XCURSOR_ in IrrCompileConfig.h.

I'm still considering disabling that by default, because I fear a lot of people will complain after the 1.8 release. But well, then again I really like to have color-cursors also on Linux by default...

Posted: Sat Jul 24, 2010 11:18 pm
by conallmmcg
i think simply updating the wiki ( linux build instructions) and adding the libxcursor-dev to dependency list and also the large apt-get command should solve most issues linux users ( debian based ) should be having ( as tbh they should be following the wiki instructions anyway)