www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Import C++ class

reply Mosfet <John doe.fr> writes:
Hi,

I wanted to know if it would be possible to import a c++ class from D ?
Feb 22 2008
parent torhu <no spam.invalid> writes:
Mosfet wrote:
 Hi,
 
 I wanted to know if it would be possible to import a c++ class from D ?

There's some limited support for that in D 2.0, you need at least dmd 2.010. But I don't think most libraries support D 2.0 yet. And the C++ class would probably have to be altered for using with D, because of the limitations. The common way of getting access to C++ code is to write a C wrapper for it. Then you can still use D 1.0 too. http://www.digitalmars.com/d/2.0/cpp_interface.html
Feb 22 2008