Build 1.1.4 on Mac OS X 10.6.5

Started by xindon, November 20, 2010, 14:31:33

Previous topic - Next topic

xindon

Hey,

I'm trying to run old Java applications using LWJGL 1.1.4 (with DevIL) on Mac OS X 10.6.5. However, the native libraries' architecture does not seem to match anymore. I'm getting the following error trace:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.javaws.Launcher.executeApplication(Launcher.java:1904)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1842)
	at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1604)
	at com.sun.javaws.Launcher.run(Launcher.java:138)
	at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.UnsatisfiedLinkError: /Users/tb/Library/Caches/Java/cache/6.0/18/7ae740d2-4a0df3af-n/liblwjgl.jnilib:  no suitable image found.  Did find:  /Users/tb/Library/Caches/Java/cache/6.0/18/7ae740d2-4a0df3af-n/liblwjgl.jnilib: no matching architecture in universal wrapper
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1823)
[..]



So now I'm trying to build 1.1.4 on Mac OS X, downloaded the source package and started ant:
Ahti:~ tb$ cd Downloads/lwjgl-source-1.1.4
Ahti:lwjgl-source-1.1.4 tb$ ant
Buildfile: /Users/tb/Downloads/lwjgl-source-1.1.4/build.xml

-initialize:

generators:
[generator] /Users/tb/Downloads/lwjgl-source-1.1.4/build.xml:636: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

generate-openal:
    [apply] Note: Generated class org.lwjgl.openal.AL10
    [apply] Note: Generated C source org.lwjgl.openal.AL10
    [apply] Note: Generated class org.lwjgl.openal.AL11
    [apply] Note: Generated C source org.lwjgl.openal.AL11

generate-opengl:
    [apply] Note: Generated class org.lwjgl.opengl.ARBBufferObject
    [apply] Note: Generated C source org.lwjgl.opengl.ARBBufferObject

... and so on


However, later I get the following error messages:

generate-all:

compile:
     [core] /Users/tb/Downloads/lwjgl-source-1.1.4/build.xml:538: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
     [core] Compiling 309 source files to /Users/tb/Downloads/lwjgl-source-1.1.4/bin
     [core] /Users/tb/Downloads/lwjgl-source-1.1.4/src/java/org/lwjgl/input/Controllers.java:5: package net.java.games.input does not exist
     [core] import net.java.games.input.ControllerEnvironment;
     [core]                            ^
     [core] /Users/tb/Downloads/lwjgl-source-1.1.4/src/java/org/lwjgl/input/Controllers.java:70: package net.java.games.input does not exist
     [core] 	private static void createController(net.java.games.input.Controller c) {
     [core] 	           

..again the same message lots of times


Can anyone help me? :) Where can I get the net.java.games package from and how do I instruct ant to use it?

Thank you very much in advance!

Regards,
Tim

kappa

why not just use the latest LWJGL 2.x? Should be much easier to port code over then to try compile such an old release. Also not sure if such an old LWJGL had support for 32bit and 64bit macs.

Quote from: xindon on November 20, 2010, 14:31:33
Can anyone help me? :) Where can I get the net.java.games package from and how do I instruct ant to use it?
That should be part of jinput.jar

xindon

Quote from: kappa on November 20, 2010, 14:55:36
why not just use the latest LWJGL 2.x? Should be much easier to port code over then to try compile such an old release. Also not sure if such an old LWJGL had support for 32bit and 64bit macs.

Oh, actually there are several projects of which I hoped never to touch the code again.. :-)

Quote from: kappa on November 20, 2010, 14:55:36
That should be part of jinput.jar

Thanks, that solved the first issue.

Now when trying to compile the native libs I get the following errors:
-compile_native_macosx:

init:
    [mkdir] Created dir: /Users/tb/Downloads/lwjgl-source-1.1.4/bin/lwjgl/ppc
    [mkdir] Created dir: /Users/tb/Downloads/lwjgl-source-1.1.4/bin/lwjgl/intel

nativelibrary:

compile:
    [apply] /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/macosx/context.m:40:42: error: CoreFoundation/CoreFoundation.h: No such file or directory
    [apply] In file included from /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/macosx/context.m:41:
    [apply] /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/macosx/context.h:45:25: error: Cocoa/Cocoa.h: No such file or directory
    [apply] /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/macosx/context.h:46:23: error: OpenGL/gl.h: No such file or directory
    [apply] /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/macosx/context.h:47:26: error: OpenGL/glext.h: No such file or directory
    [apply] In file included from /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/macosx/context.h:48,
    [apply]                  from /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/macosx/context.m:41:
    [apply] /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/common/common_tools.h:43:17: error: jni.h: No such file or directory
    [apply] /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/common/common_tools.h:44:20: error: string.h: No such file or directory
    [apply] /Users/tb/Downloads/lwjgl-source-1.1.4/src/native/common/common_tools.h:45:20: error: stdlib.h: No such file or directory
[..]


Seems like I need to set an include path.. (but how?)

Thank you :)

kappa

Quote from: xindon on November 20, 2010, 15:27:11
Seems like I need to set an include path.. (but how?)
hmm, that stuff should all be included in the build.xml for OSX, you are using the ANT build.xml to build it right?

Quote from: xindon on November 20, 2010, 15:27:11
Oh, actually there are several projects of which I hoped never to touch the code again.. :-)
Well there no major changes between the LWJGL 1.x to 2.x, the only thing you need to watch out for is the GLU package, which has been moved from package org.lwjgl.opengl to org.lwjgl.util (now in the lwjgl_util.jar).

Other then that the other thing is Devil and Fmod have been dropped, which at most will mean a rewrite of the Texture and Sound Loading classes to switch over to use the new alternative for those Slick-Util.

Might be less pain then working with a really old version of LWJGL, which is now broken on most modern computers and OS's.

xindon

Well, I finally managed to compile the Mac OS X native libraries with the 10.6 SDK and x86_64 architecture; the application starts now and the OpenGL window appears.

Unfortunately, DevIL crashes now during initialization. Eclipse says: "Invalid memory access of location 0x3250400 rip=0x7fff5fc23056". Here's the relevant part of the system crash report:

Java information:
 Exception type: Bus Error (0xa) at pc=7fff5fc23056

 Java VM: Java HotSpot(TM) 64-Bit Server VM (17.1-b03-307 mixed mode macosx-amd64)

Current thread (101801000):  JavaThread "main" [_thread_in_native, id=5246976, stack(100401000,100501000)]
Stack: [100401000,100501000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.devil.ILNative.nCreateIL([Ljava/lang/String;)V+0
j  org.lwjgl.devil.ILNative.createIL()V+115
j  org.lwjgl.devil.IL.create()V+7
j  de.bloodyblades.bsp3loader.Quake3BSPLoader.init()V+111
j  de.bloodyblades.bsp3loader.Quake3BSPLoader.<init>()V+80
j  de.bloodyblades.bsp3loader.Quake3BSPLoader.main([Ljava/lang/String;)V+3
v  ~StubRoutines::call_stub


This happens with the DevIL dylibs shipped with the 1.1.4 "optional" package as well as with the current MacPorts version.

What could cause the "bus error" exception?

Regards
Tim

Matzon

bus error is basically a pointer issue. are you sure the 32bit devil dylib is being loaded ?

xindon

Quote from: Matzon on November 21, 2010, 14:23:44
bus error is basically a pointer issue. are you sure the 32bit devil dylib is being loaded ?

I tried it with the dylib shipped with the official 1.1.4 "optional" package (of which I thought it was 32bit, isn't it?) and with my self compiled x86_64 version from MacPorts.


Matzon

dig into the native code for nCreate and find the offending line (just add printfs())