mac java dll文件,如何使用与Java一个Windows DLL在Mac OS X?

I have seen some Java projects using taucs.dll, TAUCS—a C library of sparse linear solvers, through JNI in Windows. I guess I can achieve the same in Mac OS X by compiling TAUCS into something like libTaucs.jnilib. I have access to the library's code but no idea how to compile it into a DLL, let alone a JNI library. So far I can compile only to a static library.

Is there a way to convert a DLL to a JNI library for Mac? If I have to compile the code, how to do so? Will wrapping a static library in a dynamic library work with JNI, especially for TAUCS if anyone has an experience?

解决方案

Many operating systems have the concept of shared libraries, but ofcourse the format etc. of such libraries is different on different operating systems.

DLLs (Dynamically Linked Libraries) are the Windows version of shared libraries. You cannot just use a DLL from a Windows machine on Mac OS, exactly like you cannot run a Windows application on Mac OS (or any other operating system).

Instead of trying to use a Windows DLL on Mac OS, you need to find a Mac OS-specific version of the native library that you are trying to use. Or if you have the source code, compile it into a Mac OS-native shared library. Shared libraries on Mac OS X have the extension .so (instead of .dll), which stands for "shared object".

Loading them using just Java is not possible.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值