U
U
user 81282016-01-10 01:03:00
Java
user 8128, 2016-01-10 01:03:00

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

3 answer(s)
A
Alexander Ananiev, 2016-01-10
@SaNNy32

Well, maybe there are missing dlls necessary for your dll to work correctly

O
Oleg Tsilyurik, 2016-01-10
@Olej

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).

U
user 8128, 2016-01-10
@ErvinM

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 question

Ask a Question

731 491 924 answers to any question