0

I'm on a java application that is based on written dll libraries in C. At the beginning I used JNA since it is simpler but the number of strucure to create the java code became important. And there I think JNI solve my problem since I have the DLL and header files (.h) in which the structures and function prototypes are defined. My question is how I should proceed? A good link will be welcome, the ones I've seen do not suit me

Bace
  • 23
  • 1
  • 1
  • 5
  • I did not get it. What exactly is your problem? – suns9 May 23 '16 at 07:23
  • Thank you for your reply. I get this message error "Can't find dependent libraries" when i execute. I use JNI. i tried all runway on http://stackoverflow.com/questions/6092200/how-to-fix-an-unsatisfiedlinkerror-cant-find-dependent-libraries-in-a-jni-pro but nothing. – Bace May 23 '16 at 07:55
  • Do you load every librairies needed by calling System.loadLibrary(.dll). Are you sure to put the library files at the correct path in your IDE ? – suns9 May 23 '16 at 08:12
  • I used Dependency-walker to find all library dependency. I put all library in C:\Windows\System32 and now i am facing with this message Can't load library: C:\WINDOWS\system32\hal – Bace May 23 '16 at 09:07
  • I don't really know how to include dll (Windows) in Android (Linux). You do not have your library in .so format? – suns9 May 23 '16 at 11:32
  • i am working on eclipse on windows platform. I have to implement an java application which relies on dll files wrote in C which are provided me. I have also lib files and header files(.h) in which several structures and function prototypes are defined. Now i want to create a java wrapper with JNI like this : public class JNI_PROCESS { static { System.loadLibrary("libDLL/hal"); } public static final native int init(); public static final native int process(); } But when i run this code i get the message error above. – Bace May 23 '16 at 14:18
  • You got the above error message because your dll file is not included in the apk package. This means the dll file might not put in the correct folder in your eclipse project. The other things is you tries to load a dll file in Android (Linux kernel). You should probably develop a wrapper (have a look on http://stackoverflow.com/questions/5908660/how-to-import-dll-to-android-java-project-working-with-eclipse) – suns9 May 23 '16 at 15:08
  • Thank you very much, i try this runway and revert to you – Bace May 23 '16 at 15:49

0 Answers0