Reputation: 3056
Is there a common approach to writing C++ application API in a way simplifying interop with other languages? Maybe something like using a higher-level interface description language to generate C++ interface together with marshalling code for other platforms (.NET, python, ...)?
Upvotes: 4
Views: 303
Reputation:
There are several options.
If you want to interop with .net, you can write C++/CLI wrapper classes. These allow you to write C++ classes that are directly visible from .net, and in their implementation can use your native C++.
Historically, COM was also usesd for this purpose, but it is less popular nowadays.
There is also a library called SWIG that will interop with Java and other languages.
Edit: It looks like it will be easier on windows 8 with WinRT components
Upvotes: 2
Reputation: 1
Another possibility might be to make extern "C"
all your publicized API (even if its implementation is in C++).
Upvotes: 0
Reputation: 1716
SOAP/WebServices/Corba?
Although it seems like you were thinking tighter (ie.like linker) coupling than that.
Upvotes: 1