如何在 Mac OS X 中使用带有 Java 的 Windows DLL? [英] How to use a Windows DLL with Java in Mac OS X?

查看:25
本文介绍了如何在 Mac OS X 中使用带有 Java 的 Windows DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过一些使用 taucs.dll 的 Java 项目,TAUCS——一个稀疏线性求解器的 C 库,通过 Windows 中的 JNI.我想我可以通过将 TAUCS 编译成 libTaucs.jnilib 之类的东西在 Mac OS X 中实现相同的效果.我可以访问库的代码,但不知道如何将其编译成 DLL,更不用说 JNI 库了.到目前为止,我只能编译为静态库.

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.

有没有办法将 DLL 转换为 Mac 的 JNI 库?如果我必须编译代码,该怎么做?将静态库包装在动态库中是否可以与 JNI 一起使用,尤其是对于 TAUCS,如果有人有经验的话?

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?

推荐答案

微软终于发布了 .NET Core 完全独立于平台.当您使用 .NET Core 框架构建 DLL 时,您可以使用以下命令运行该文件.

Finally Microsoft released .NET Core which is completely platform independent. When you build a DLL using .NET Core framework you can run the file with following command.

dotnet yourapp.dll

此外,现在可以使用轻量级 IDE Visual Studio Code 在 Mac 或 Linux 机器上开发 .NET 应用程序和Visual Studio for Mac IDE 已发布,其中 MacOS X 上的 Mono 已集成.

Also, now .NET applications can be developed on Mac or Linux machine using the lightweight IDE Visual Studio Code and Visual Studio for Mac IDE has been released where Mono on MacOS X is integrated.

这篇关于如何在 Mac OS X 中使用带有 Java 的 Windows DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆