Hello Guest

architecture word width mismatch (?) when using devil

  • 6 Replies
  • 17031 Views
*

Offline manji

  • *
  • 41
    • toyWars
architecture word width mismatch (?) when using devil
« on: February 18, 2009, 00:03:41 »
I'm trying to run lesson06 of NeHe, using the devil optional package in a 64bit linux system. While the class is compiled successfully, when I run it I get the following error:

Code: [Select]
run:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/stathis/various/lwjgl-2.0.1/native/linux/liblwjgl-devil.so: /home/stathis/various/lwjgl-2.0.1/native/linux/liblwjgl-devil.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1030)
        at org.lwjgl.devil.ILNative$1.run(ILNative.java:69)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.devil.ILNative.loadLibrary(ILNative.java:62)
        at org.lwjgl.devil.ILNative.<clinit>(ILNative.java:77)
        at org.lwjgl.devil.IL.create(IL.java:590)
        at nehe.lessons.Lesson06.init(Lesson06.java:202)
        at nehe.lessons.Lesson06.run(Lesson06.java:72)
        at nehe.lessons.Lesson06.main(Lesson06.java:67)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

I read somewhere that this might have to do with the jdk 64bit edition I'm using, and maybe I should try the 32bit. If so, can I use the 32bit just for Netbeans and the 64bit for the rest of the system?

*

Offline Matzon

  • *****
  • 2242
Re: architecture word width mismatch (?) when using devil
« Reply #1 on: February 18, 2009, 07:43:22 »
lwjgl doesn't support devil and fmod any more since 2.0

*

Offline manji

  • *
  • 41
    • toyWars
Re: architecture word width mismatch (?) when using devil
« Reply #2 on: February 18, 2009, 23:19:51 »
I read about it on other posts too... It sucks, but if there was no way to maintain it, so be it. Could someone please show me an example of how to use slick-util, the recommended replacement for Devil, to load a texture?

Re: architecture word width mismatch (?) when using devil
« Reply #3 on: March 18, 2009, 02:09:24 »
I read about it on other posts too... It sucks, but if there was no way to maintain it, so be it. Could someone please show me an example of how to use slick-util, the recommended replacement for Devil, to load a texture?

You could change to the SWT in the LWJGL 2. For example,
Code: [Select]
import org.eclipse.swt.graphics.ImageData;
(skip......)
int loadTexture(String imgPath) {
ImageData  img      = new ImageData(imgPath);
int        width    = img.width;
int        height   = img.height;
byte[]     data     = new byte[img.data.length];
for(int i=0; i<img.data.length; i++)
data[i] = img.data[img.data.length-(i+0x1)];
ByteBuffer scratch  = ByteBuffer.wrap(data);
IntBuffer  buffer   = ByteBuffer.allocateDirect(0x4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL11.glGenTextures(buffer);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, buffer.get(0x0));
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0x0, GL11.GL_RGB, width, height, 0x0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, scratch);
return buffer.get(0x0);
}

I hope the example which can help you.  ;D

Best regads,
embeddednode
« Last Edit: March 27, 2009, 09:23:12 by embeddednode »

*

Offline Matzon

  • *****
  • 2242
Re: architecture word width mismatch (?) when using devil
« Reply #4 on: March 18, 2009, 19:33:55 »
or just:
TextureLoader.getTexture(format, new FileInputStream(texfile));

*

Offline manji

  • *
  • 41
    • toyWars
Re: architecture word width mismatch (?) when using devil
« Reply #5 on: March 22, 2009, 10:21:54 »
embeddednode thank you, I downloaded SWT and I'll work on your code. Also, I found that the spaceinvaders (http://www.cokeandcode.com/node/9) game uses Texture and TextureLoader classes.

Matzon, I didn't get it, where is the TextureLoader class you say?

*

Offline Matzon

  • *****
  • 2242
Re: architecture word width mismatch (?) when using devil
« Reply #6 on: March 22, 2009, 11:34:17 »
org.newdawn.slick.opengl.TextureLoader