Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use windows static libraries from java code with minimal effort (prefereably using JNA)

I have to use some static windows library (*.lib) from java code, I can write C++ JNI wrappers, but I'd rather not do it (not that experienced in C++).

What would be the easiest (least developement effort) way use it, performance is not important, since that code will just be fetching some data, that most probrably will be worked on on JAVA side.

Most probably I would use JNA, but AFAIK it needs dynamic libraries, and I have static ones.

I also asked question on converting static libraries to dynamic ones.

like image 497
jb. Avatar asked Jun 23 '26 05:06

jb.


1 Answers

You can always create a DLL (dynamic library) project which calls directly into your static library, and then you can use JNA with the new created DLL.

like image 193
Francis Avatar answered Jun 24 '26 19:06

Francis