编译webassembly问题

vscode,绑定代码如下

class_<CTZPoint>("CTZPoint")

        .constructor<>()

        .constructor<double, double, unsigned char, unsigned char>()

        .property("x", &CTZPoint::x)

        .property("y", &CTZPoint::y)

        .property("State", &CTZPoint::State)

        .property("Attr", &CTZPoint::Attr);

    value_object<COLORREF>("COLORREF")

        .field("red", &COLORREF::red)

        .field("blue", &COLORREF::blue)

        .field("green", &COLORREF::green);

    class_<CDrawStkFont>("CDrawStkFont")

        .constructor<COLORREF, wstring, wstring, CTZPoint, double>()

        .property("font_info", &CDrawStkFont::font_info, allow_raw_pointer<FONT_CHAR_DATA *>())

        .property("sti_info", &CDrawStkFont::sti_info, allow_raw_pointer<DST_DSB_UTTERLY *>());

类代码如下

class CTZPoint

{

public:

    double x;

    double y;

    BYTE State;

    BYTE Attr;

    CTZPoint()

    {

        x = 0;

        y = 0;

        State = 0;

        Attr = 0;

    };、

CTZPoint(CTZPoint &a)

    {

        x = a.x;

        y = a.y;

        State = a.State;

        Attr = a.Attr;

    };

    CTZPoint(double dx, double dy, BYTE bState, BYTE bAttr)

    {

        x = dx;

        y = dy;

        State = bState;

        Attr = bAttr;

    };

    ~CTZPoint(){};

    void operator=(const CTZPoint &a)

    {

        x = a.x;

        y = a.y;

        State = a.State;

        Attr = a.Attr;

    };

    bool operator==(const CTZPoint &a) { return ((x == a.x) && (y == a.y) && (State == a.State) && (Attr == a.Attr)); };

};

报错

 error: no matching constructor for initialization of 'CTZPoint'

'emscripten::class_<CDrawStkFont>::constructor<COLORREF, std::wstring, std::wstring,
 CTZPoint, double>'
requested here
.constructor<COLORREF, wstring, wstring, CTZPoint, double>()
note: candidate constructor not viable: expects an lvalue for 1st argument
CTZPoint(CTZPoint &a)
note: candidate constructor not viable: requires 0 arguments, but 1 was provided
CTZPoint()
note: candidate constructor not viable: requires 4 arguments, but 1 was provided
CTZPoint(double dx, double dy, BYTE bState, BYTE bAttr)

将拷贝构造函数删除后解决此错误,搞不懂。

有可能是不支持地址传输的原因。。。。。。不懂
 

  • 6
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值