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
Pink Floyd
Posts: 32
Joined: Fri Jan 21, 2005 9:32 pm
Location: Genoa (Italy)

Irrlicht on Linux

Post by Pink Floyd »

Hello guys,
can someone tell me how to configure the libraries for working with Irrlicht on Linux?
I tried to pass to g++ the .a files as options:
g++ mysource.cpp -libIrrlicht.a .....
but /usr/bin/ld doesn't find them (I've placed them in my app's same directory)

any suggestion?
Andreas
Posts: 166
Joined: Sun Oct 31, 2004 7:15 am
Location: Münster / Germany
Contact:

Post by Andreas »

Hi there,

i had some trouble compilling the first tutorial, this is what finally worked for me:

Code: Select all

g++ -I/usr/include/irrlicht/ -o main main.c  -lIrrlicht
Of course you have to change the pathname according to your installation... :)
If i misunderstood your problem, please ignore my post.

so long
andreas
Pink Floyd
Posts: 32
Joined: Fri Jan 21, 2005 9:32 pm
Location: Genoa (Italy)

Post by Pink Floyd »

where did you place the .a libs?
deprecated
Posts: 62
Joined: Fri Jan 07, 2005 4:37 pm
Location: California

Post by deprecated »

Code: Select all

 g++ main.cpp -o main -I"[path to IRR include]/include" -I"/usr/X11R6/include" -L"/usr/X11R6/lib" -L"[path to irr lib]/lib/Linux" -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lz -ljpeg
-I is where your irrlicht headers (and X11 headers) are located.
-L where the irrlich lib is located.

The other libs use ld to fine em...

I keep my libs / includes in the Irrlicht dir, so that i can have multiple versions of the engine without having to keep more than a makefile up-to-date.

(note.. if you untar source and end up modifying it, remove old include dir and make a sybolic link from ./Irrlicht/include --- to ---> ./Irrlicht/source/Irrlicht/include)
Pink Floyd
Posts: 32
Joined: Fri Jan 21, 2005 9:32 pm
Location: Genoa (Italy)

Post by Pink Floyd »

here's what happens

pinkfloyd@pinkfloyd:~/Desktop/programmazione/3d/progs $ g++ model.cpp -o model -I"/h*/p*/D*/pro*/3d/irr*/inc*/" -I"/usr/X11R6/include" -L"/h*/p*/D*/pro*/3d/irr*/lib/" -L"/usr/X11R6/lib" -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lz -ljpeg /usr/bin/ld: cannot find -lIrrlicht
collect2: ld returned 1 exit status

I'm sure that the include and lib directories are true
I've also tried to keep them in an easier path (simply "/include/" and "/lib/") but I always get that error:

cannot find lIrrlicht
Pink Floyd
Posts: 32
Joined: Fri Jan 21, 2005 9:32 pm
Location: Genoa (Italy)

Post by Pink Floyd »

can someone give me a help?
(sorry for the double post)
mm765
Posts: 172
Joined: Fri May 28, 2004 10:12 am

Post by mm765 »

id try it with full pathnames instead of the shortened ones(*)
Andreas
Posts: 166
Joined: Sun Oct 31, 2004 7:15 am
Location: Münster / Germany
Contact:

Post by Andreas »

Hi again.

OK, i'll explain how it works on my system, but in short, i guess the problem is that you don't specify the path to libIrrlicht.a correctly (I think it needs a "-L")...

so, my system:
-Gentoo Linux with kernel 2.6.10,
-Irrlicht version 0.7 (extracted zip, not the ebuild)

the important paths:

Code: Select all

/home/sensen/Coden/main.cpp 

the code from tutorial1 copy & pasted, see http://irrlicht.sourceforge.net/tut001.html

Code: Select all

/opt/noebuild/irrlicht
the location where i unziped the irrlicht.zip

Code: Select all

/usr/X11R6
this is the path of needed X libraries

Now to compile main.cpp while in the directory /home/sensen/Coden i simply run:

Code: Select all

g++ -I/opt/noebuild/irrlicht/include/ -o main main.cpp -L/opt/noebuild/irrlicht/lib/Linux/ -lIrrlicht -L/usr/X11R6 -lX11 -lXxf86vm -ljpeg -lz -lGL
I hope this helps, a short notice of success would be nice :)

so long,
Andreas
Pink Floyd
Posts: 32
Joined: Fri Jan 21, 2005 9:32 pm
Location: Genoa (Italy)

Post by Pink Floyd »

wohaaaa! it works, thank you Andreas

The only thing I had to change was the location of X11 libraries, which is not (for me) /usr/X11R6 but /usr/X11R6/lib

Now I can start working with Irrlicht on both Windows and Linux :D

(I use Ubuntu)
Post Reply