SomeUser
SomeUser

Reputation: 2041

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

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

Upvotes: 6

Views: 4040

Answers (5)

pm100
pm100

Reputation: 50220

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

Upvotes: 3

Hassan Syed
Hassan Syed

Reputation: 20496

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.

Upvotes: 1

womp
womp

Reputation: 116987

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.

Upvotes: 6

Brian Agnew
Brian Agnew

Reputation: 272417

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

Upvotes: 8

vicatcu
vicatcu

Reputation: 5887

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

Upvotes: 4

Related Questions