0

First, I'm using JDK 8 32bits with Eclipse 32bits.

I'm trying to figure out how to solve this error:

java.lang.UnsatisfiedLinkError :

I checked signature's functions in C and package in JAVA but it looks right.

The complete error is :

Exception in thread "main" java.lang.UnsatisfiedLinkError: fr.Model.initModel(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I)V

Java's function:

void initModel(String, String, String, int[]) in package fr and class Model

C function:

JNIEXPORT void JNICALL Java_fr_Model_initModel (JNIEnv  *, jobject, jstring, jstring, jstring, jintArray);

Launching it in a separate JVM but it does find the .dll. All dependencies checked, they are in system32.

Already doing the extern "C" { ... } trick to deal with C++.

Any ideas?

  • What compiler do you use? I seem to remember that at least for 64-bit DLLs you have to add some special option when you want to use the library with JNI. Maybe it's the same for 32-bit DLLs. – user2543253 Nov 08 '19 at 15:30
  • I'm using MinGW as i'm on Windows. It used to work someday and I didn't change anything to it so the options are prob right. Only thing that changed for compilation is upgrading from Java 6 to Java 8 but it doesn't change anything to the compilation process according to my researches. – IngeniousDev Nov 08 '19 at 15:40
  • You could try with Visual Studio anyway. – user2543253 Nov 08 '19 at 15:58
  • Is it going to change anything? Anyway I have to make a release and deploy it.on other machines, without any IDE so... – IngeniousDev Nov 08 '19 at 16:02
  • If something in the binary created by gcc is indeed the culprit, it might help. And of course you can deploy libraries built with Visual Studio on other machines. Even better: if you can use the version the JDK was built with (don't know, however, if that is available as a community edition) the user machines don't need the extra VC redistributable because the JDK has the needed VC runtime library – user2543253 Nov 08 '19 at 17:14
  • Found it: https://stackoverflow.com/questions/17199904/why-do-i-get-unsatisfiedlinkerror-when-calling-a-mingw-compiled-function-not-lo – user2543253 Nov 11 '19 at 09:55
  • Yup you found it ! Thank you !! – IngeniousDev Nov 12 '19 at 10:19

0 Answers0