Let's say I have written a library containing many classes in C++. Obviously, I can call this library from C++ client programs.
But, now let's say I want to use another language for my client programs. Since my C++ library contains many classes, I don't want to redevelop them in the client language.
So, I would like to be able to call my C++ library classes from other languages.
Also, I want the solution to be portable across platforms. I don't want to be tied to one platform (such as .NET where any .NET language can call any other .NET language).
In the extreme case, this inter-language call feature would be required even from "managed" languages such as Java.
So, my question is: Is it possible to call a library function written in one language, from a program written in another language? If so, how?
export "C"
your interface and call it a day, if that will suffice. – Mael Jan 31 '18 at 09:25