Answer the question
In order to leave comments, you need to log in
How to properly build .dll for JNI?
Hello!
I have a C++ dynamic library that I pull with JAVA (generated .h file with .javah and implemented .cpp).
The library works only on the PC on which it was built (I collect Visual Studio).
Reinstalling Windows - catching Unsatisfied Link Error.
Tell me, please, what are the nuances when assembling .dll for Windows 7 and higher?
If necessary, I will share the code (1 method, 20 lines)
Answer the question
In order to leave comments, you need to log in
Well, maybe there are missing dlls necessary for your dll to work correctly
With dynamic libraries, most often such problems are with the location (directory) of such a library + the search paths for dynamic libraries installed in the system (there are quite voluminous and complex search rules).
When I collect dll in Preprocessor Definitions, I specify the path to
C:\Development\Java\jdk1.8.0_66\include
C:\Development\Java\jdk1.8.0_66\include\win32
and when I changed the operating system, these paths changed.
Is it possible to specify these paths via %JAVA_HOME%?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question