C ++ interacts with other languages

Is there a general approach to writing C ++ application APIs that makes interaction with other languages ​​easier? Maybe something like using a higher level interface description language to create a C ++ interface along with coding code for other platforms (.NET, python, ...)?

+4
source share
3 answers

There are several options.

If you want to interact with .net, you can write C ++ / CLI wrapper classes. This allows you to write C ++ classes that are directly visible from .net, and your own C ++ can be used in their implementation.

Historically, COM has also been used for this purpose, but is currently less popular.

There is also a library called SWIG that will interact with Java and other languages.

Edit: It looks like Windows 8 will be easier with WinRT components

+2
source

SOAP / WebServices / Corba?

Although it seems that you are thinking of a closer (that is, as a linker) connection than this.

+1
source

Another possibility might be to make extern "C" your entire public API (even if its implementation is in C ++).

0
source

Source: https://habr.com/ru/post/1388840/


All Articles