是否有类似 .dll 或 .so 的东西,但跨平台?

发布于 2024-08-18 23:43:39 字数 33 浏览 5 评论 0原文

有没有类似 .dll 或 .so 的东西,但跨平台?

is there something like .dll or .so, but cross-platform?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

紫南 2024-08-25 23:43:40

目前尚不清楚您在问什么,但如果您问“如何以跨平台方式制作可动态加载的 C/C++ 库”,那么答案是 GNU Libtool。它支持构建和使用它们,以及运行时支持功能

It's not clear what you are asking, but if you are asking "how can I make dynamically loadable C/C++ libraries in a cross-platform manner," then the answer is GNU Libtool. It has support for building and consuming them, plus runtime support functions

樱&纷飞 2024-08-25 23:43:40

正如其他人提到的,事实并非如此。也许有一天 LLVM 将弥合这一差距,让我们能够像研究静态/动态对象库一样研究 LLVM 等价物。

看看 此回复解释了静态对象库通常不可移植的一些原因。我说一般是因为有时——如果操作系统供应商足够关心的话——这是可能的——比如 freebsd 执行 Linux 二进制文件,或者 WINE 实现大部分 win32 运行时。

As others have mentioned, not really. Perhaps LLVM will one day bridge the gap allowing us to look at LLVM equivalents as we do static/dynamic object libraries.

Take a look at this reply for some of the reasons why static object libraries aren't generally portable. I say generally because sometimes -- if the OS vendors care enough -- it is possible -- like freebsd executing linux binaries, or WINE implementing a large part of the win32 runtime.

枫林﹌晚霞¤ 2024-08-25 23:43:39

Java .class 文件和 .jar 档案将满足此要求,在 Mono 下运行的 .Net 程序集也将满足此要求。

Java .class files and .jar archives will fulfil this requirement, as will .Net assemblies running under Mono.

瞄了个咪的 2024-08-25 23:43:39

通用可执行格式?不。

这就是虚拟机(java)或IL(.Net)存在的全部原因 - 因此相同的源代码可以编译成通用中间语言,然后可以由底层系统字节码中的框架执行,而无需程序员必须了解系统之间的差异。

在实践中,VM 必须在所有平台上一致地实现。

A universal executable format? No.

That's the whole reason for the existence of virtual machines (java) or IL (.Net) - so the same source code can be compiled into a universal intermediate language, that can then be executed by the framework in the underlying system bytecode without the programmer having to know the differences between the systems.

In practice, the VM has to be consistently implemented on all platforms.

写下不归期 2024-08-25 23:43:39

不适合 c/c++ AFAIK,java 有一些类似的 .jar 文件。

not for c/c++ AFAIK, java has .jar files that are sort of analogous though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文