Page 8 of 49

Posted: 28 Feb 2007, 02:06
by AF
and does aflobby say that?

Posted: 28 Feb 2007, 02:08
by elio
AFlobby console output names the exact folder it is in, so it's not that.

Posted: 28 Feb 2007, 02:10
by AF
yes it does, it outputs the current working directory followed by the library path

Code: Select all

me folder as AFLobby, path: "+ intendedpath+" library path:"+System.getProperty("java.library.path",".")
please post exactly what it says in your console so I can be sure, especially since all I know about mac is "it doesnt work"

Posted: 28 Feb 2007, 02:30
by elio
rather, "it doesn't find the library".

Code: Select all

update!
working directory : /Users/elio/Desktop/aflobbyalpha17

Unsatisfied link error, make sure you have a JNI aware unitsync library in the same folder as AFLobby, path: /Users/elio/Desktop/aflobbyalpha17 library path:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

Posted: 28 Feb 2007, 02:32
by 10053r
your script didn't work, AF, but I set the environment variable manually before I launched spring, and I got the same result. See my most recent error message post. I seems like java doesn't care about the environment variable.

Posted: 28 Feb 2007, 02:36
by elio
I've stuck it in each of the paths etc with and without lib prefix with and without jnilib suffix etc, no luck.

Posted: 28 Feb 2007, 02:51
by AF
let me make this clear:

Unsatisfied link error, make sure you have a JNI aware unitsync library in the same folder as AFLobby,

path: /home/username/Desktop

library path:/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/client/:/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386:/usrl/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/../lib/i386

the value in path: cannot be found by searching the string library path:. therefore the environment variable does not contain the working directory (path:)

thus is it not logical to try to put the file in one of those java directories?

Also kloot can you verify it works on your PC? Afterall you compiled the linux version..

the same of the mac error:

working directory : /Users/elio/Desktop/aflobbyalpha17

Unsatisfied link error, make sure you have a JNI aware unitsync library in the same folder as AFLobby,
path: /Users/elio/Desktop/aflobbyalpha17
library path:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

This red part confuses me somewhat, I can only think ths could be caused by the way the library was compiled.

Posted: 28 Feb 2007, 02:54
by elio
thus is it not logical to try to put the file in one of those java directories?
I've stuck it in each of the paths etc
...

Posted: 28 Feb 2007, 02:55
by AF
AF to linux user wrote:thus is it not logical to try to put the file in one of those java directories?
Mac user wrote:I've stuck it in each of the paths etc

Posted: 28 Feb 2007, 02:57
by AF
I'm not a linux/mac user and I've no experience to draw on here. I didnt compile the linux java unitsync, I dont run linux, and I know very little specific to linux. Someone else should compile unitsync with java bindings who cant use kloots version to see if its the library or that specific build. Otherwise I'm grasping at straws here.

Posted: 28 Feb 2007, 03:01
by elio
library path:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

This red part confuses me somewhat, I can only think ths could be caused by the way the library was compiled.

that's nothing to do with the library; it's just how java search path is; . == current dir; : is just the individual path separators. It's either looking for some random name, or it's just not finding what it's after. All I did was a straight compile with the java binding c file included.

Posted: 28 Feb 2007, 03:02
by elio
Someone else should compile unitsync with java bindings who cant use kloots version to see if its the library or that specific build. Otherwise I'm grasping at straws here.
I'm not using kloots' version, just compiling in your .c

Posted: 28 Feb 2007, 03:04
by AF
hmmz.

Code: Select all

* Loads a code file with the specified filename from the local file
* system as a dynamic library. The filename
* argument must be a complete path name.

System.load()
if you can, try recompiling AFLobby with the exact path to unitsync including extension e.g. /usr/home/libunitsync.so

It may also be worth prepending file:// to the start if that doesnt work.

Posted: 28 Feb 2007, 08:14
by SupaSonic
Ok, I think I get what's going on here.
I got the same error btw. So I made a new Java file and just tried to load unitsync.so in it. Had no luck with System.loadLibrary, so went for System.load()
Here's the code:

Code: Select all

public class LoadLib {
	public static void main (String args[]) {
		System.load("/home/sonic/eclipse/workspace/Test Project/libunitsync.so");
	}
}
It loads the library, but still gives the following exception:

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/sonic/eclipse/workspace/Test Project/libunitsync.so: Can't load IA 32-bit .so on a IA 32-bit platform
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(Unknown Source)
	at java.lang.ClassLoader.loadLibrary(Unknown Source)
	at java.lang.Runtime.load0(Unknown Source)
	at java.lang.System.load(Unknown Source)
	at LoadLib.main(LoadLib.java:7)
it would seem that unitsync depends on IA 32-bit .so, which Java can't find.

Posted: 28 Feb 2007, 09:22
by SupaSonic
Okay, after searching for a bit, I found out that this error message is inconclusive. The solution was to either downgrade or upgrade jre. So I downloaded java 1.6, recompiled and re-run my program using java 1.6. This time the error message was much more specific:

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/sonic/eclipse/workspace/Test Project/libunitsync.so: /home/sonic/eclipse/workspace/Test Project/libunitsync.so: undefined symbol: glPushAttrib
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
	at java.lang.Runtime.load0(Runtime.java:770)
	at java.lang.System.load(System.java:1005)
	at LoadLib.main(LoadLib.java:3)
So there's something wrong with the glPushAttrib.

Posted: 28 Feb 2007, 11:03
by Tobi
Recompile unitsync using the setup.py script in tools/unitsync, ie.:

Code: Select all

tools/unitsync/setup.py build
In the SConstruct it just links against all libs Spring links to, including GL etc...

Posted: 28 Feb 2007, 11:14
by SupaSonic
it gives me an error:

Code: Select all

Traceback (most recent call last):
  File "setup.py", line 11, in ?
    import intopts
ImportError: No module named intopts

Posted: 28 Feb 2007, 11:15
by Tobi
It depends on scons configure, run that first.

EDIT: hm, actually that script drags in all libs too..., guess someone has to fix either of them...

Posted: 28 Feb 2007, 20:05
by AF
hmmm, its a relief to see a new lead in this mess, I just tried ubuntu in MSVPC2007 and it hangs when booting into safe graphics mode =(.

Posted: 28 Feb 2007, 20:06
by AF
btw there's a checklink() function that takes the library file name (I assume pathname too), I assume it would give the same output as loadlibrary but it may be of use if the scons issue turns out to be a dead end.