Page 1 of 1

Weird flashy linux error...

Posted: Mon May 16, 2005 8:46 am
by IllegalEnzyme
hi, i've just compiled the demo i've been making on linux (mandriva) and when i run my app the window just flashes and dissapears, yes before you ask i have got a main loop. I get this output in the console:
Irrlicht Engine version 0.6
Linux
Creating X window...
Starting fullscreen mode...
Connecting glx context to window...
Window created.
OpenGL Renderer.
OpenGL driver version is 1.2 or better.
Multitexturing disabled.
Loaded texture: #DefaultFont
JPEG parameter struct mismatch: library thinks size is 464, caller expects 428
i think the last line is an error message, but i have know idea what it means.

Can anyone help?

Posted: Mon May 16, 2005 11:02 am
by schick
You probably linked against the wrong libjpeg. Updating Irrlicht to 0.9 may help.

Posted: Tue May 17, 2005 8:23 am
by IllegalEnzyme
ok i'll try and link to the correct lib, any idea how i can find out which is the right one?

Posted: Tue May 17, 2005 11:31 am
by hybrid
The one Irrlicht library was compiled with. If you just link against -ljpeg you will usually get the one installed in /usr/lib or somewhere else in your system. But you will need the one provided with Irrlicht (or the one you used during compilation of Irrlicht). You can use an absolute path to the Irrlicht jpeg lib instead of using the -ljpeg switch by adding /path/to/irrlicht/Libs/libjpeg.a as an additional object file if you cannot figure out how to set library search paths.

Posted: Tue May 17, 2005 5:11 pm
by ondrew
You are linking against libjpeg.a in irrlicht/lib/Linux. But execution happens against /usr/lib/libjpeg.a

The directories linux searches for libraries upon execution are defined in file /etc/ld.so.conf
when you change the /etc/ld.so.conf execute

Code: Select all

# ldconfig
You have three possibilities:
1. the easy one - delete irrlicht/lib/Linux/libjpeg.a
1. the bad one - add directory irrlicht/lib/Linux to your /etc/ld.so.conf (before /usr/lib) and execute ldconfig (can break other apps)
3. the best one - change your Makefile
from

Code: Select all

 -L"../../lib/Linux" -L"/usr/X11R6/lib"
to

Code: Select all

 -L"/usr/X11R6/lib" -L"../../lib/Linux" 
Don't worry about the difference in Makefile including from /usr/X11R6/lib and executing from /usr/lib. Standard linuxes have libjpeg on both places; usually hardlinked.

Posted: Tue May 17, 2005 8:19 pm
by hybrid
Sorry, but this is nonsense. You're thinking about shared libraries, whereas libjpeg is built as an object archive for Irrlicht. If you're linking with -ljpeg this does not make any difference, i.e. both versions can be used for linking. During run-time it makes a difference, though. If you linked against libjpeg.a this link is done statically, i.e. all objects from libjpeg are included in the executable. If you're using shared libs, final linking is done during execution time. But you may even mix these two forms as long as the header files used during compiling Irrlicht and the ones delivered with your version of libjpeg are the same.
In the case mentioned n this thread the structs do not match, i.e. headers were different. Fortunately the programmers of libjpeg cared for this, otherwise this would have been a possible security problem.
Anyway, if you're using Irrlicht as available from the SDK, or you compiled it using unaltered sources, you are best off using a static binding with the libjpeg version that comes with Irrlicht.
Otherwise you can set your linker search path with -L/path/to/libs. But since libjpeg is in a standard search path you will have to change Irrlicht linking against the local libjpeg to the one on your system. Note that you also have to change include paths which are set by -I/path/to/incs

Posted: Tue May 17, 2005 9:36 pm
by ondrew
damn, I suck so much. :oops: you're totally right.

Posted: Thu May 19, 2005 11:21 am
by IllegalEnzyme
sorry i didn't understand what you just said, could you spell it out for me?

Posted: Thu May 19, 2005 12:33 pm
by hybrid
If you did not recompile Irrlicht itself you have to use the libraries coming with the distribution. In order to link with these files use -L/your/path/to/Irrlicht/Libs -lIrrlicht -ljpeg -lz
You should only be sure to have no other link directory between -lIrrlicht and -ljpeg
In case you recompiled Irrlicht library you have to use the very same include and link parameters as used at that time to include the same headers and libraries.
If nothing helps you may want to post your Makefile to get some hints on it.

Posted: Fri May 20, 2005 4:11 pm
by IllegalEnzyme
yay, it works now thanx hybrid...

...however i'm only getting 2fps!

i have no idea what's going on, i used to get approx 70 on windows,

any help?

Posted: Fri May 20, 2005 4:52 pm
by Mike
Open a console and type glxinfo. Look for the word Mesa in the output. If you see it, you're running OpenGL in software, without hardware acceleration. Turn to Google to find information on how to remedy this for your card.

Posted: Mon May 23, 2005 9:22 am
by IllegalEnzyme
thanx mike i'll try and get it working.