5

I've got an simple API with native functions(JNA) inside a DLL file which only calculates some mathematical stuff. I am using this DLL inside an JAVA application and everything works fine on the windows JVM.

The problem is that this library is going to be used in a Linux enviroment inside a Linux JVM and there will be no *.so version.

I read a couple of times that there is a way to load the DLL with wine inside the memory and use it from there but without explanations how to do it.

Can somebody confirm or refute this approach for me. And could tell me how to do it if this is really a possible sollution, please?

edit: Could be a solution which is described in How to call Wine dll from python on Linux? Can I somehow use ctypes?

Regards wurmi

Rich
  • 15,048
  • 2
  • 66
  • 119
wurmi
  • 333
  • 5
  • 18
  • 2
    (You might find it easier to recompile the mathematical stuff in linux C, or port it to Java, if you have the source.) – Rich Oct 13 '15 at 09:01

1 Answers1

3

I think you should be able to do this, but I can't find a step-by-step guide, and I haven't done it myself. Try doing the following:

Good luck!

Hopefully someone who has done this before will provide a more detailed answer here. If not, be sure to post how to do it as an answer so that others can benefit :-)

(The answer you linked to is referring to Windows-provided DLLs, and Wine ships with so-compiled versions of those.)

Rich
  • 15,048
  • 2
  • 66
  • 119
  • Thank for your help. I will try your idea. This means i dont need to change my java application to much. – wurmi Oct 13 '15 at 09:21
  • Well this wiki wasnt able to solve my problem. The code snippet includes for example the "windows.h" file. That is not available in a linux enviroment. Also the compiling wit wineg++ thorw a lot of errors which are not easy to google for. E.g. "expected initializer before ‘.’ token WINE_DEFAULT_DEBUG_CHANNEL(foo.bar)" – wurmi Oct 13 '15 at 15:06
  • "The code snippet includes for example the "windows.h" file. That is not available in a linux enviroment. " -- I think it is included with WINE on linux. – Rich Oct 13 '15 at 16:08
  • Maybe try asking this question on https://www.winehq.org/mailman/listinfo/wine-users ? – Rich Oct 13 '15 at 16:09