Re: IKVM UnsatisfiedLinkError on Java using Native Library

David Thielen <[email protected]> Sat, 20 Oct 2018 17:35:33 +0000
Newsgroups gmane.comp.java.ikvm.devel
Message-ID <SN1PR12MB04302B11B8A8789D829BC82BC1FA0@SN1PR12MB0430.namprd12.prod.outlook.com>
I'm not an expert on IKVM but my guess is there's no way it can do anything with native code. IKVM converts jar files from Java byte codes to .net clr codes. Native code is not Java byte codes.

You'll have to provide that native code part outside of Java/IKVM.

- dave


-----Original Message-----
From: [email protected] <[email protected]> 
Sent: Saturday, October 20, 2018 11:17 AM
To: [email protected]
Subject: [Ikvm-developers] IKVM UnsatisfiedLinkError on Java using Native Library

Hi everyone!

I'm currently building a project in Unity3D and for that I need to use a Java library. In order to import this Java Library I use IKVM
(www.ikvm.net) to convert the Jar file into a .Net .dll library. This works if I use a normal Java program, but the library I need must load some Native (C++ if I'm not wrong) libraries and apparently this doesn't work if I use the JVM provided by IKVM. I get following error:

UnsatisfiedLinkError: Can't load library:  
C:\Users\SWT\AppData\Local\Temp\qi.dll
java.lang.ClassLoader.loadLibrary (java.lang.Class , System.String , Boolean ) java.lang.Runtime.load0 (java.lang.Class , System.String ) (wrapper synchronized) java.lang.Runtime:load0
(java.lang.Class,string) java.lang.System.load (System.String filename, ikvm.internal.CallerID ) com.aldebaran.qi.SharedLibrary.extractAndLoad (java.net.URL , System.String ) com.aldebaran.qi.SharedLibrary.loadLibHelper
(System.String ) com.aldebaran.qi.SharedLibrary.loadLib (System.String
name) com.aldebaran.qi.EmbeddedTools.loadEmbeddedLibraries () com.aldebaran.qi.Session..cctor () Rethrow as
TypeInitializationException: An exception was thrown by the type initializer for com.aldebaran.qi.Session nao.Controller.initialize ()

Does anyone have an idea on what I could do to solve this problem? If it is somehow helpful I'm using the Naoqi SDK for Java that is used to control a NAO Robot. Thank you in advance!

Regards,

Miguel

PS: I think it is also important to mention that this library works perfectly if I run it with my own JVM, instead of the JVM that uses the IKVM tool.



_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers