Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 250
SomeUser Avatar asked Jan 25 '10 22:01

SomeUser


People also ask

Are DLL cross platform?

DLLs are Microsoft's implementation of the idea of a "shared library." You can only use them on platforms that, in some fashion, implement support for them. In general, this means that no, you can't just take the DLL files you have and use them on Android, or on a macOS installation, or whatever. Now, things like .

Are DLL files platform independent?

you can not write platform independent dlls. They depend on the architecture (x86 or x64) and only work on windows.

What is equivalent of DLL in Java?

The Java analog to a DLL is the . jar file, which is a zip file containing a bunch of Java . class files and (perhaps) other resources. See Sun's, er, Oracle's documentation. Copy link CC BY-SA 2.5.

Is a DLL a shared library?

A Dynamically Linked Library (DLL) is a library that can be shared by several applications running under Windows. A DLL can contain any number of routines and variables. One advantage of DLLs is that you can change and enhance them without forcing all the applications that depend on them to be relinked or recompiled.


3 Answers

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

like image 171
Brian Agnew Avatar answered Oct 19 '22 18:10

Brian Agnew


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.

like image 36
womp Avatar answered Oct 19 '22 19:10

womp


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

like image 29
vicatcu Avatar answered Oct 19 '22 17:10

vicatcu