cygwin: Can't load IA 32-bit .dll on a AMD 64-bit platform & solution

Started by kazaak, May 26, 2012, 17:59:28

Previous topic - Next topic

kazaak

I pulled my hair out trying to figure out why I was getting this error.  I'm running JDK 1.7.0 on windows 7 pro 64 bit on an AMD Phenom II.  I found lots of references to uninstalling and reinstalling the jdk, old threads here about the first 64-bit release, but nothing helped.

When I tried running it I got:

C:\DOS\jgl-2.8.3>java -cp .;res;jar/lwjgl.jar;jar/lwjgl_test.jar;jar/lwjgl_util.jar;jar/jinput.jar; -Djava.library.path=native/windows org.lwjgl.test.WindowCreationTest
The following keys are available:
ESCAPE:         Exit test
ARROW Keys:     Move window when in non-fullscreen mode
L:              List selectable display modes
0-8:            Selection of display modes
F:              Toggle fullscreen
SHIFT-F:        Toggle fullscreen with Display.destroy()/create() cycle
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\DOS\jgl-2.8.3\native\windows\lwjgl.dll: Can't load IA 32-bit .dll on a AMD 64-b it platform
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(Unknown Source)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.lwjgl.Sys$1.run(Sys.java:73)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
        at org.lwjgl.Sys.loadLibrary(Sys.java:95)
        at org.lwjgl.Sys.<clinit>(Sys.java:112)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
        at org.lwjgl.test.WindowCreationTest.initialize(WindowCreationTest.java:82)
        at org.lwjgl.test.WindowCreationTest.main(WindowCreationTest.java:286)

With -Dorg.lwjgl.util.Debug=true, I got access denied errors on lwjgl64.dll.

It turns out, I'd unzipped the lwjgl zip file with cygwin unzip.  So I dealt with permissions the windows way going into native/windows and (in a cygwin bash shell) chmod 777 *.  Everything worked.

Wanted to post this in case anyone else ran into the same problem.

Matzon

wow, I'd imagine a lot of wasted time on that issue! - thanks for sharing

masteriti

I had a similar issue with a totally unrelated cause.  I use Eclipse 3.7 running on a Win7 64bit machine.  My project references several libraries directly, including jme3 and slick2d.  This error popped up because the ordering in my Build Path had the Slick2D (which was making the call to the native library) was above the actual lwjgl libs.

FIX: Open Build Path Configuration -> Order and Export Tab -> move libraries that depend on lwjgl down at the bottom.  Hope this helps others.