d与c++接口,类似这样.

extern(C++, cv){
extern(C++, class) struct Size_(T){
    @disable this();
	~this() { }

    final T area() const;
    final double aspectRatio() const;
    final bool empty() const;

    T width; //!< the width
    T height; //!< the height
}
}

编译命令类似这样:
link d.obj 常用.obj phobos2-ldc.lib druntime-ldc.lib
用微软的链接器,用ldc2的编译器.

posted @ 2020-03-16 10:51  zjh6  阅读(17)  评论(0)    收藏  举报  来源